How do I add something to the “Edit Tag” page in wp-admin?

There is the in_admin_footer hook that’s right before the “Thank you for creating with WordPress.” text in the footer, you can check if you’re on a tag edit screen in that hook. function wpse_277416_admin_footer() { $screen = get_current_screen(); if ( $screen->id === ‘edit-post_tag’ ) { echo ‘Hello world!’; } } add_action( ‘in_admin_footer’, ‘wpse_277416_admin_footer’ ); That’s … Read more

Adding function to child theme’s function.php

You can’t recall the same function or PHP will throw an error. Make your own function and call the same action hook, but give it a priority of 1 which should overrule the parent theme function. function custom_oblique_post_link_to_single() { if ( ! get_theme_mod( ‘read_more’ ) ) :?> <a href=”https://wordpress.stackexchange.com/questions/282703/<?php the_permalink(); ?>”> <div class=”read-more”> <?php echo … Read more

Send an e-mail notification to custom user role when a file is uploaded to uploads folder

You could use the wp_mail function https://developer.wordpress.org/reference/functions/wp_mail/ to send an email to anyone after the file is successfully uploaded in your directory. You do not need any action here Add it your code after the file is uploaded successfully if(empty($errors)==true){ move_uploaded_file($file_tmp,”/$user_dirname/”.$document); echo “The file was uploaded successfully!”; wp_mail(..); }else{ print_r($errors); } }

Force default OG:Image – Yoast SEO [closed]

The action that allows an OG image to be added seemed to be the thing I was looking for, so much for proper documentation on their side. But now the only thing I’m wondering if the following code I made up is the proper way to deal with it: $default_opengraph=”https://www.rafaeldejongh.com/wp-content/uploads/2017/08/RafaelDeJongh-Web-Developer-3D-Artist.jpg”; function add_default_opengraph($object){global $default_opengraph; $object->add_image($default_opengraph);} add_action(‘wpseo_add_opengraph_images’,’add_default_opengraph’); … Read more

Send notification email to admin for every new post published

You can use the transition_post_status hook. <?php add_action( ‘transition_post_status’, ‘custom_send_admin_email’, 10, 3 ); function custom_send_admin_email( $new_status, $old_status, $post ) { if ( ‘publish’ === $new_status && ‘publish’ !== $old_status ) { // Consider sending an email here. } } Here’s a second example that also checks for a specific post type. Note that $post is … Read more