Dynamically Override Fancy Title

The original function ends with this line: return apply_filters( ‘presscore_get_page_title’, $title ); That’s your cue. You can build a filter that completely overrules the $title generated by that function. Like this: add_filter (‘presscore_get_page_title’,’wpse263380_presscore_get_page_title’,10,1); function wpse263380_presscore_get_page_title ( $title ) { $title=”My awesome title”; return $title; }

Adding a form at the end of the content

If I understand what you are doing, and the problem you are having, the first thing I’d try is to add your the_content filter with a large priority number so that it runs late, and hopefully after the other formatting filters. add_filter(‘the_content’,’your_callback’,100); If that doesn’t do it you may have to remove and reorder some … Read more

Hook for post permalink update

You need to exactly use wp_insert_post_data. This contains array of post data what will be store into database after WordPress has done all of the validation/sanitization. add_filter(‘wp_insert_post_data’, ‘wpse_wp_insert_post_data’, 10, 2); function wpse_wp_insert_post_data($data, $post_attr) { // you get the post_name using $data[‘post_name’]; // post id will not be present for the first insert // but you … Read more

Detect type of post status transition

If not, how do I tie multiple hooks to the same action? Do I just list them like so: add_action(‘new_to_publish’, ‘save_new_post’, 10, 1); add_action(‘future_to_publish’, ‘save_new_post’, 10, 1); add_action(‘draft_to_publish’, ‘save_new_post’, 10, 1); This is exactly the way to go. Just hook the same callback into each of the status-transition hooks on which you want the callback … Read more

add_action on inherit post status

I’m running into this same issue in some code I’m developing. In your case though tree is a better hook as you only want to hook posts that are moving to ‘publish’ You need to hook your function into all of the possible {status}_to_publish hooks like this: add_action(‘new_to_publish’, ‘my_function’); add_action(‘draft_to_publish’, ‘my_function’); add_action(‘auto-draft_to_publish’, ‘my_function’); add_action(‘pending_to_publish’, ‘my_function’); … Read more