FAQ

What are the requirements of the plugin?

You need at least WordPress 3.9 running on your self-hosted WordPress installation AND PHP in a version greater than 5.3. If you don’t know how to update your PHP version, check this quick blog post for a start: How to update to the latest PHP version for WordPress.

How can I activate the plugin?

  1. Please upload the plugin files to your /wp-content/plugins/ folder.
  2. Then head to the “Plugins” section in your WordPress administration panel. Click “Activate”.
  3. After that you will be asked to enter your Envato username + purchase code. Click here if you don’t know where you can find your Envato purchase code. Click the blue “Activate” button.
  4. That’s it! After that you should find a new menu item called “Content after Posts”.
Activate the Content-After-Posts WordPress Plugin
Activate the Content-After-Posts WordPress Plugin

What are the Actions and Filters I can use?

Filters

  • wpbcap_config
    Use this filter to change the config settings. Has one parameter: (array) $wpbcap_config
  • wpbcap_content
    Called whenever a “post after content” content gets printed. Has 4 parameters: (string) $content, (int) $cap_id, (string) $where, (WP_Post) $post
  • wpbcap_post_type_args
    Gets called when the post type wpbcap gets generated. Has one parameter: (array) $args
  • wpbcap_custom_condition
    Allows to add your own conditional checks for the visibility of a CAP. Must return false to skip including the CAP to the content. Has three parameters: (int) $cap_id, (stdClass) $cap, (WP_Post) $post
    The $cap object has the following properties: (int) cap_id, (array) post_types, (string|array) include, (string|array) exclude, (int) priority
  • wpbcap_custom_condition_pre
    Allows you to omit all conditions and include the CAP directly when true is returned. Has three parameters: (int) $cap_id, (stdClass) $cap, (WP_Post) $post
  • wpbcap_is_on_sql
    Allows you to manipulate the SQL query. Has two parameters: (string) $sql, (WP_Post) $post
  • wpbcap_older_than
    You can change the time for the “older than” parameter. Has one parameter: (int) $time_in_seconds

Actions

  • wpbcap_before_{$type}_input
    Use this to add HTML before a special setting on the settings page. $type is the current settings type (ex. text, number, range, textarea, etc.). Can have two parameters (parsed by reference): (array) $args, (mixed) $value
  • wpbcap_after_{$type}_input
    Use this to add HTML after a special setting on the settings page. $type is the current settings type (ex. text, number, range, textarea, etc.). Can have two parameters (parsed by reference): (array) $args, (mixed) $value

How can I deactivate all CAPs (Content after Posts) on a single page or post?

That’s an easy one. ;-) Just edit the page and scroll down to the “Content After Posts” metabox. Then mark the checkbox “Don’t show CAPs”. That’s it ;)

Deactivate Content After Post one a page
Deactivate Content After Post one a page

Can I use it within a network installation (network enabled, using it on all sub-blogs)?

No. At the moment this is not possible. The plugin has to be activated on each plugin separately. But (as always) you can add a feature request.

Can i use it to put feature images for my old posts?

No. The reason for this is that WordPress’ content area does not allow dynamic content (like PHP). But maybe you can use this plugin: allow PHP in posts and pages.

Does this plugin load anything in the frontend, that will slow down the site?

The plugin has to check if there is a content for the page that is currently called (otherwise it wouldn’t work). But it shouldn’t slow down your site. I always recommend the usage of a caching plugin anyway ;)

Is the priority setting also for the ordering of these items?

Yes. The priority allows to reorder the content (because other plugin can also add content to the top/end of a post/page/custom post type).

How can I remove the “About”, “Social Media” and “Help” section when editing a CAP?

Since Version 1.1.0. it’s possible to deactivate these sections through the language file. For example if you want to deactivate the “about” section open the language file /assets/langs/content-after-posts-en_US.po with your favorite language editor (like PoEdit). Search for the Entry “on [Display “About” meta box (on|off)]” and translate it to “off”. Save your file. That’s it.

Notes:

  1. Don’t forget to do this with other language files, too.
  2. Don’t forget to upload the *.mo file via FTP to your webserver.

Turn About-Box off

Does it work with Visual Composer?

Yes the plugin does work with Visual Composer since version 1.1.0. Please note that in some cases the “Backend Editor” button will not show up. In this case please do the following:

  1. Go to your WordPress dashboard.
  2. Go to “Settings” -> “Visual Composer”.
  3. Just hit the “Save Changes” button.

For those who are interested why this helps: my plugin hooks into the get_option filter WordPress provides. If Visual Composer gets installed the first time, no settings/options are saved to the database (it just loads the default post types internally) and so the filter will be ignored. In fact: my plugin cannot hook into the filter to activate the CAP post type to show the “Backend Editor” button. Nerdy? Don’t worry… just hit he save button ;)