Hook for number of items in Appearance > Menus > CustomPostType > View All [duplicate]
Traced down this long-standing issue. This plugin seems to fix the problem by removing pagination altogether.
Traced down this long-standing issue. This plugin seems to fix the problem by removing pagination altogether.
Firstly assign your Custom fields group to the post type you are trying to show them in, then call them in that post types template like you have done already. For the template part, you need to copy single.php from the Parent theme. EDIT: For the cutomizr theme you have to make changes in the … Read more
I looked around again with a more relaxed mind and figured out that the_posts is the action hook I was looking for. This is how I just did it: add_action( ‘the_post’, function ( $post ) { $count = (int) get_field(‘views’); $count++; update_field(‘views’, $count); } ); Now I’ll just figure out how to sort it by … Read more
$args = array ( ‘hide_empty’ => 1, ‘exclude’ =>array(1,2,3) // id of categories ); $categories = get_categories($args);
when the shortlink is created, an action is trown with this line : do_action(‘fts_use_shortlink’, $post_id, $shortlink); then you can hook your code on the action with this code e.g. in the 2nd plugin : add_action(“fts_use_shortlink”, function ($post_id, $shortlink) { // here you can use $shortlink }, 10, 2); // 10 is the priority when there … Read more
It is better to use ‘comment_post’ action for this purpose, it is fired when the comment is saved in database: add_action(‘comment_post’, ‘my_comment_post_callback’, 10, 3); function my_comment_post_callback($comment_id, $comment_approved, $commentdata) { if (strpos($commentdata[‘comment_content’], ‘dog’) !== false) { $post_url = get_permalink($commentdata[‘comment_post_ID’]); wp_delete_comment($comment_id, true); wp_redirect($post_url); exit; } }
There’s a couple of ways to do it, you can edit the template file \woocommerce\templates\single-product\title.php directly and change your title format there. Otherwise, you can remove the WordPress hook in your functions.php file and add your own to override it which I borrowed from this answer <?php remove_action( ‘woocommerce_single_product_summary’,’woocommerce_template_single_title’, 5 ); add_action( ‘woocommerce_single_product_summary’, ‘modify_woocommerce_template_single_title’,5 ); … Read more
I would start by creating in the themes functions.php a function like this public function greenday_head($args) { return $args } It may be that $args are never passed in but it seems likely they are. If you want to try to find out what this is doing then you can add: public function greenday_head($args) { … Read more
I think you just need to load the translations earlier to make them available for ajax hooks: add_action( ‘plugins_loaded’, ‘myplugin_load_textdomain’ ); function myplugin_load_textdomain() { load_plugin_textdomain( ‘myplugin’, false, basename( dirname( __FILE__ ) ) . ‘/languages’ ); }
Try to use the post object provided by the action as the second parameter instead of getting it from database: function change_event_slug_on_save( $post_id, $post ) { … } add_action( ‘save_post’, ‘change_event_slug_on_save’, 10, 2 ); With this you can remove the line $post = get_post($post_id); EDIT: Tribe Events Calendar has it’s own actions for saving an … Read more