Linux 软件免费装

MaGiKS Proper PHP Include

开发者 kjlock75
更新时间 2011年1月28日 09:35
捐献地址: 去捐款
PHP版本: 3.0.4 及以上
WordPress版本: 3.0.4

标签

php short codes include file

下载

详情介绍:

MaGiKS Proper PHP Include lets you easily, quickly, efficiently and safely insert PHP code into posts, pages and / or widgets, without disabling the Visual Editor. You simply upload a php file containing your code into your theme folder and use a WordPress shortcode to "include" that file into your posts / pages / widgets. This plugin uses a filter to add shortcode capability for widgets in case that functionality isn't already present. If it is, then it is redundant, and I'm sorry ;) MaGiKS Inc.

安装:

  1. Upload the magiks-proper-php-include folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Create a .php file containing the code you want to "include" into your content
  4. Upload the .php file to your current theme folder - for easy updating later
  5. Use the shortcode [m_include_file filepath="/filename.php"] within your content

常见问题:

Why did you create this plugin?

I created this plugin because I needed the ability to include the exact same content in multiple places but I only wanted to update it in just one place... plus WP-Ads stopped working for me. As a bonus I knew I can include PHP in the file as well.

Does the include file have to have PHP code in it?

No, you can add any HTML, JavaScript, etc. in there, with or without PHP, which can be handy if you have the same content that you would like to display in multiple places but only want to update in just one.

Aren't there already plugins that do this?

Maybe. As far as the execution of PHP goes, I only found ones that either require the Visual Editor to be disabled, or claim that it doesn't. I have found in my testing that the ones that suggest you can leave the Visual Editor on did not work as desired for me. My code would still break. Not that I use the Visual Editor often, but my clients do. So to suggest turning it off to get plugins to work is just silly IMHO.

Are you a magician?

No, but thanks for asking.

更新日志:

0.1.1