WordPress publish_post hook not getting featured image and meta on first publish, but works on updating title

I don’t know if it’s the Gutenberg editor or if it’s the hook publish_post The hook itself works, and if you used the old WordPress post editor, then the issue in question would not happen. So you can say that it’s the Gutenberg/block editor. why it’s not returning the meta and featured image Because Gutenberg … Read more

WordPress bulk category select when publishing post

The default function that renders the categories meta box is post_categories_meta_box – it doesn’t have any internal hooks we can use to inject our own HTML, so let’s create our own meta box handler and just use the function internally: function wpse_406861_post_categories_meta_box( $post, $args ) { post_categories_meta_box( $post, $args ); echo <<<HTML <label> <input type=”checkbox” … Read more

Stop wordpress from creating empty/null entries

When i needed a solution to the save “problem” i create an Ajax function to validate the fields and did some minor JQuery hacks: first we add our JavaScript to capture the submit/publish event and use it to submit our own ajax function before the actual submit add_action(‘wp_print_scripts’,’my_publish_admin_hook’); function my_publish_admin_hook(){ if (is_admin()){ ?> <script language=”javascript” … Read more

run script on publish

It looks like it could be because the filter cannot find the include file. Try using: include( ABSPATH. “/path/to/file/jobsfeed.php” )

add_action hook for publish_post not working

When a post is published/saved, it does not do it in a single script execution. It redirects to a different script, does the save, then redirects back to where you started. If you want to confirm that your hook is working, use update_option(), and delete the option immediately after displaying it so it’s not latent … Read more

Custom Meta Box Causing Error: “Are you sure you want to do this? Please try again.”

so you need to correct your nonce field add a second pram nonce name, more information on WordPress codex here // wp nonce field wp_nonce_field( $action, $name, $referer, $echo ); // replace yours with below wp_nonce_field( ‘ind_pricing_table_box_nonce’, ‘ind_pricing_nonce’ ); now verify your nonce, more info here wp_verify_nonce( $nonce, $action ); // replace yours with below … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)