I am creating a front end dashboard where I need to show all the posts by the current user. So, I need to show posts in publish

I’m afraid I don’t understand the question perfectly, so I apologize, but, $post_status=”publish”; Wouldn’t that do it? I am missing context though, are you building a query? Because to get all the posts by the current user, something like this would be needed: $args = array( “post_status” => “publish”, “author” => get_current_user_id(), “posts_per_page” => 10 … Read more

Edit the Publish Widget Options

I think you should use the post_submitbox_misc_actions add_action( ‘post_submitbox_misc_actions’, ‘publish_in_frontpage’ ); function publish_in_frontpage($post) { $value = get_post_meta($post->ID, ‘_publish_in_frontpage’, true); echo ‘<div class=”misc-pub-section misc-pub-section-last”> <span id=”timestamp”>’ . ‘<label><input type=”checkbox”‘ . (!empty($value) ? ‘ checked=”checked” ‘ : null) . ‘value=”1″ name=”publish_in_frontpage” /> Publish to frontpage</label>’ .'</span></div>’; }

SQL: Search query to get attachments only of those parents which are published

Well since nobody helped with at first look such an easy problem, i used my way, and if somebody will need it here it is: I used this query: $results = $wpdb->get_results( $wpdb->prepare( “select $wpdb->posts.ID, $wpdb->posts.post_status, $wpdb->posts.post_parent from $wpdb->posts where post_title like ‘%%%s%%’ and (post_type=”albumas” OR post_mime_type=”audio/mpeg”) AND (post_status=”inherit” OR post_status=”publish”) $excludes limit 0,”.$setting->limit, ($setting->search_content … Read more

Remove “minor-publishing” div from Publish admin metabox

In short- no. The html in question is hard-coded in the post_submit_meta_box callback function. You can, of course de-register the publish metabox and re-register your own which mimics post_submit_meta_box (but making your alterations) and being sure to keep the names of the inputs exactly the same. This method has been outlined the following posts where … Read more

Plugin that generates a page of post content

I still don’t exactly get it. I would advise you to take it one step at a time first. Your function takes in a post_id, so that is an existing post. If you then get that post’s title and then you call get_page_by_title, obviously that is going return you the same than get_post already did. … Read more