Safely changing UserID’s, re-using deleted UserID’s and automatically using deleted userID’s instead of an increment
Safely changing UserID’s, re-using deleted UserID’s and automatically using deleted userID’s instead of an increment
Safely changing UserID’s, re-using deleted UserID’s and automatically using deleted userID’s instead of an increment
Consequence of the post auto incrementer off?
Try using this: $post_id = get_the_ID(); OR global $post; $post_id = $post->ID; OR $post = $wp_query->post; $post_id = $post->ID;
You should be able to use get_current_user_id(). Note that it will return ‘0’ if the user isn’t logged in. <a href=”https://example.com/?user_id=<?php echo get_current_user_id(); ?>”>Link</a> Update 2: Got bored, made a plugin: https://github.com/AndyMardell/append-user-id/releases/tag/v1.0.0-alpha Download the zip and install 🙂 Submitted to WordPress but it’s still under review. Installation and Usage: https://github.com/AndyMardell/append-user-id#installation Update: you won’t be able … Read more
How to get the url of the entry in which an image belongs
get_current_user_id() always return 0 in if else statement
Use the the_date() or get_the_date( ‘d/m/Y’, $post->ID ) functions. This will show only the date of your post type. If you are outside the loop, you need to use the second function I’ve suggested with the post id passed as param.
Trying to get property ‘ID’ and ‘post_author’ of non-object error
Reuse old post ID for new post after deleting post
You can use get_page_by_path() to get a Page’s WP_Post object using its slug (ie, its path), and then use that object to then get the array of child page IDs using get_children(). // First we’ll create the list of posts (pages) to exclude. $exclude = array(); $parent_page_obj = get_page_by_path( ‘abc’ ); if ( ! empty( … Read more