Site cannot access external connection
Site cannot access external connection
Site cannot access external connection
There’s a hook save_post, docs here: https://developer.wordpress.org/reference/hooks/save_post/ which will allow you to run some code after the post is saved. Example from there: function add_user_after_post_save( $post_id ) { // add a user? // move the post to the user? } add_action( ‘save_post’, ‘add_user_after_post_save’ ); Not sure why you’d need to call the hook immediately before … Read more
is_user_logged_in returns false when I access certain pages
There’s wp_schedule_single_event: $in_ten_minutes = time() + 10 * 60; $post_id = get_the_ID(); wp_schedule_single_event( $in_ten_minutes, ‘notify_post_event’, array( $post_id ) ); or similar – I’ve no idea if it’s just the post ID you need, or whether get_the_ID() is the right way to find it when you’re handling this action. Depending on where the button is and … Read more
Do you know how recursive functions are working? Here is an example: function get_categories_list( $parent ) { $args = array( ‘taxonomy’ => ‘product_cat’, ‘hide_empty’ => false, ‘parent’ => $parent ); $current_level_categories = get_terms( $args ); $result=””; if ( $current_level_categories ) { foreach ( $current_level_categories as $cat ) { if ( $cat->name == ‘Uncategorized’ ) continue; … Read more
Pages from admin dasboard missing after site migration
The code exactly as you put it in your question works fine for me and does exactly what you suggested. To make it work I had to make sure my WP post editor was in code editor mode as HTML or Visual Editor may create extra problems: And this is what my test code in … Read more
Try using save_post hook instead. Check this example: https://gist.github.com/fgilio/38dfbf9d03654b21302a
This is because the directory of wordpress is wrong. the whole of wordpress files should have been extracted in /var/www/html/device1.com.
Use PHP ternary comparsion operator to check if get_user_meta() function returns blank or non-blank result: function colaborador_nome($atts) { if (is_user_logged_in() && !is_feed()) { return ‘ ’. (get_user_meta( get_current_user_id(), ‘first_name’, true ) ?: “Hi >No Name<, please settle your name in your account.”); } } add_shortcode(‘colaborador_nome’, ‘colaborador_nome’);