The generate_before_copyright hook appears inside the .inside-site-info element within the footer.
Usage
Please refer to the Using Hooks article to learn how to use this hook.
Author 詩語
generate_mobile_cart_items
Note: This hook is included in GP Premium.
The generate_mobile_cart_items hook appears inside the .wc-mobile-cart-items element.
Usage
Please refer to the Using Hooks article to learn how to use this hook.
wp_footer
Note: This hook is included in the GP Hooks add-on inside GP Premium.
The wp_footer hook is a standard hook in WordPress that appears before the closing element of your website.
Usage
Please refer to the Using Hooks article to learn how to use this hook.
generate_page_header_legacy_metabox
The generate_page_header_legacy_metabox filter allows you to bring back the Page Header meta box on your posts.
In GPP 1.4, the meta box was removed from individual pages and replaced by a custom post type.
Usage
add_filter( 'generate_page_header_legacy_metabox', '__return_true' );
Disallow PHP Execution
DISALLOW_FILE_EDIT is defined. Your should also disallow PHP execution in GP Hooks.
If you see this message, it means you have the following line in your wp-config.php file:
define( 'DISALLOW_FILE_EDIT', true );
If you didn』t add this code, it』s likely you』re using a security plugin which has added it for you.
This is recommended by WordPress as an extra layer of security. By disabling file editing, you prevent bad people who gain access to your Dashboard (bad in itself) from executing PHP and gaining access to your server.
GP Hooks also has a constant you can define to disallow PHP execution from within the hooks:
define( 'GENERATE_HOOKS_DISALLOW_PHP', true );
If DISALLOW_FILE_EDIT is defined, then you should disable PHP execution in GP Hooks. Likewise, if you disable PHP execution in GP Hooks, you should define DISALLOW_FILE_EDIT as well.
Where to add it
This constant should be added into your wp-config.php file, below the DISALLOW_FILE_EDIT constant.
Removing the admin message
If for some reason you want to keep PHP execution in GP Hooks (and disallow file editing), you can remove the admin message added by GP Premium with this function:
add_action( 'after_setup_theme', 'tu_remove_hooks_php_check' );
function tu_remove_hooks_php_check() {
remove_action( 'admin_notices','generate_hooks_php_check' );
}
generate_blog_masonry
Note: This filter is included in GP Premium.
The generate_blog_masonry filter allows you to apply masonry to a custom post type.
See example here.
Usage
Please refer to the Using Filters article to learn how to use this filter.
generate_leave_comment
The generate_leave_comment filter allows you to change the default Leave a Comment text.
Default (string): Leave a Comment
Usage
Please refer to the Using Filters article to learn how to use this filter.
Example
add_filter( 'generate_leave_comment','tu_custom_leave_comment' );
function tu_custom_leave_comment() {
return 'Join the conversation';
}
generate_back_to_top_start_scroll
The generate_back_to_top_start_scroll filter allows you to choose how far from the top of the screen the button appears.
Default (integer): 300
Usage
Please refer to the Using Filters article to learn how to use this filter.
generate_tag_list_output
The generate_tag_list_output filter controls the output of your tags as shown in your post meta along with your blog posts.
Usage
Please refer to the Using Filters article to learn how to use this filter.
Page Header Overview
The Page Header add-on in GP Premium gives you the ability to add a really nice hero section to your website.
To use this add-on, first make sure GP Premium is installed, and that the add-on is activated.
Please refer to the related articles below for specific instructions.
Video Overview