這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Specific Files

外掛說明

With this plugin, you will be able to include certain CSS or JS files in only selected posts, pages, or other post types, instead of including them everywhere. You can also edit inline CSS & JS and include CSS & JS files from anywhere on specific posts and pages.

It places meta boxes in the WordPress post editor so it’s easy to select which files you want to include with the post you’re currently editing. This plugin works well for all websites, large and small, and it works well with WordPress multi-site (WordPress MU). Tested up to 3.1 beta 2.

See this plugin’s page on my website for information/comments/questions. I am open to the idea of suggestions and patches to this plugin! If you enjoyed this plugin, please donate or say thanks.

Todo:

  • Add a “remove references” button on the options page so people can remove file references without having to delete the file.

螢幕擷圖

  • This is the plugin options page for Specific Files. It is used for uploading new files (you can also upload via FTP), viewing files, and deleting files.
  • The two meta boxes appear on the right side near the bottom. They use a multiple-selectable <select> element for easy selecting.
  • Advanced options include inserting inline CSS & JS into the header of your page or post.
  • Advanced options also include the ability to include your CSS & JS files from anywhere.

安裝方式

  1. Upload /specific-files-for-posts-and-pages/ to the /wp-content/plugins/ directory.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Upload your CSS files to /wp-content/specific-files/css/ directory.
  4. Upload your JS files to /wp-content/specific-files/js/ directory.
  5. Use the meta boxes in the WordPress post editor to select the CSS and JS files that you wish to include.

常見問題集

Will updating remove my CSS and JS files?

No. Only plugin core files will be overwritten.

I deleted a file with my FTP client. Now I’m getting 404 errors in my server logs. What’s going on?

When you delete one of your CSS or JS files with your FTP client, the plugin won’t automatically remove all references to that file (in case you were simply deleting to reupload it again or some other case. It tries to preserve the calls to your files. In order to remove these calls, use the plugin’s options page. Using the delete button on the plugin’s options page will remove the file and all references to that file in your posts and pages.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Specific Files〉的開發相關工作。

參與者

將〈Specific Files〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.3.3

  • Adding es_ES translations

1.3.2

  • Checking support for WordPress 3.5. All is well.

1.3.1

  • Squashed bug: https://wordpress.org/support/topic/plugin-specific-files-using-quick-edit-deselects-all-specified-files-in-post?replies=1
  • Squashed bug: When CSS or JS meta boxes are hidden, they cleared out the files that were included in the post.

1.3

  • Added support for custom post types.
  • Added option to enable support for custom post types.
  • Added a few isset()’s to get rid of potential PHP notices.
  • Updated screenshot-1.jpg to show the updated options page.

1.2.1

  • Relocated CSS & JS file directory to /wp-content/specific-files/ for more stability.
  • Added option to hide CSS and/or JS meta box.

1.2

  • Added ability to include inline CSS & JS and CSS & JS files from anywhere on the internet.
  • Added ability to hide the new advanced options.
  • Improved security with a nonce and a few more current_user_can()’s.
  • Improved filename scrubber.
  • Updated screenshots.

1.1.3

  • Plugin works 100%
  • Removing crappy versions.

1.1.2

  • Attempting to add some backwards compatibility.

1.1.1

  • Added capability to preserve CSS & JS files on update.
  • Added function: copyr() for copying directories recursively.
  • Improved AJAX delete file reliability on options page.
  • Added settings page link on WordPress plugins admin page.
  • Added donate box on plugin options page.

1.1

  • Added support for JavaScript files.
  • Added meta box for JavaScript files.
  • Rearranged plugin options page/optomized user interface.

1.0

  • Original release. (Not public).