List post by title length

Add the following to your functions.php for the on save. This will create a meta value on save that stores the length of the post title. function save_crosses_title_length( $post_id ) { $title = get_the_title($post_id);//get the title $length = strlen( $title );// get the length of title if ( get_post_meta( $post_id, ‘name_length_crosses’ ) ) {//if meta … Read more

Can’t add_action to ‘save_post’ and get it to fire

When editing a post using the admin interface the wp-admin/post.php script redirects you after saving the post. This is done to avoid resubmitting the post request if you refresh the page after submitting. It also means that you’re not able to output anything during the save_post action. case ‘editpost’: check_admin_referer(‘update-post_’ . $post_id); $post_id = edit_post(); … Read more

Prevent loading of functions

I’ll assume add_css and add_js are wrappers for wp_enqueue_style and wp_enqueue_script. As such, the way you register any style / script is through either wp_dequeue_style and wp_dequeue_script, where you pass the handle of the scripts. See: https://developer.wordpress.org/reference/functions/wp_dequeue_script/ Now, from that code alone, it doesn’t seem like he’s passing any handles to these “register” functions, so … Read more