Function Reference/human time diff for future posts

You could also do it using human_time_diff hook, but it would make it global: function my_time_diff_mins( $since, $diff, $from, $to ) { return $since . ($from > $to ? ‘ from now’ : ‘ ago’); } add_filter( ‘human_time_diff’, ‘my_time_diff_mins’, 10, 4 );

How to clone all WordPress Rest API end points

There is nothing wrong if API returns more than what you need. Unless there is a security/privacy issue it is unlikely that the additional info will matter. If you totally can not live with core’s API, you need to just write your own. “cloning”, “forking” or any other nice term you might want to use … Read more

How do I prepare strings for insertions as values into a MySQL table?

dbDelta is really meant for creating databases or tables, not inserting records. I’d suggest using $wpdb->insert(), which will escape the values for you: $wpdb->insert( $wpdb->prefix . ‘w2bw2c_venue’, array( ‘market_id’ => 7, ‘venue_name’ => get_the_title( $id ), ), array( ‘%d’, ‘%s’, ) ); I’ve just used the name field you were having trouble with in my … Read more

Adding Updated Post Date PHP Custom Theme

In the template, right after the echo get_the_date(), add $before = ” Modified: ” ; // note spaces before and after string $after = ” “; the_modified_date( $d, $before, $after, $echo ); See https://codex.wordpress.org/Function_Reference/the_modified_date for date formatting options. One of those examples might be what you want to see. Of course, you’ll want to use … Read more

Automatically generator a WordPress installation on my subdomain

You’ll want to setup a Multis-site network – https://codex.wordpress.org/Create_A_Network If you know your way around code what you’ll need to do is use the wpmu_create_blog() function – https://codex.wordpress.org/WPMU_Functions/wpmu_create_blog – to create a blog whenever a user registers. What I would recommend would be a front-end form so when someone registers they can enter the name … Read more

Correctly Using checked function of WordPress

Now, based on your full code, there’s 3 problems: Line 60 of your code is missing a semi colon and throwing a fatal error. So: $instance[‘description_check_box’] = $new_instance[‘description_check_box’] Should be: $instance[‘description_check_box’] = $new_instance[‘description_check_box’]; On line 66, you’re using strings instead of proper boolean true or false values. Both if these are ‘truthy’ (see this answer … Read more