Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
9 votes
3 answers
6k views

How to prevent a post from being deleted?

For auditing issue, I only want a post can be trashed, but not deleted - for all users. So I have a plugin like add_action('before_delete_post', function($id) { wp_die(0); }); But seems ...
Yoga's user avatar
  • 919
8 votes
3 answers
4k views

How can I make it so the Add New Post page has Visibility set to Private by default?

I'm trying to create a plugin that alters the Add New Post page so the Visibility field says "Private" by default: Status: Draft Visibility: **Private** Publish immediately [Publish] ...as opposed ...
Matt Refghi's user avatar
2 votes
2 answers
3k views

Article source link for posts

Is there a way to add a source link at the end of an article like TechnoBuffalo (scroll down to end of post) with a plugin? If someone could find a plugin or quickly make one for me that would be ...
r.w's user avatar
  • 23
6 votes
2 answers
6k views

How to add option box in "Edit Post" plugin API?

This might be kind of simple, but I couldn't find a way to do so in the WP docs. My plugin currently uses custom fields for things I could just have radio buttons/check boxes for each post. How do I ...
Jon Phenow's user avatar
3 votes
2 answers
4k views

How to get posts by content?

I found the following codes to get post details. However, it is not possible to get the posts by content. Does any one has any ideas? get_posts() //// get post //// $args = array( 'numberposts' ...
goodseller's user avatar
2 votes
1 answer
3k views

How to create a Page alias in WordPress

In the image you see... WordPress has alias for Pages like Home Page, Checkout Page, Privacy Policy Page and any appear beside the page you assign them. How to create this feature in WordPress? If I ...
besrabasant's user avatar
2 votes
1 answer
6k views

Plugin for changing a post's category based on it's post date?

Is there a plugin for Wordpress that will change a post's category based on how long that post has existed? I have seen other Wordpress plugins that use a library called "simple pie" to manage a wp-...
leeand00's user avatar
  • 509
1 vote
3 answers
2k views

Share buttons on article footer

for a website I need to place facebook and twitter share buttons on the footer section of each article on the blog page (where are listed all the articles). I tested many social plugin and was able ...
Terix's user avatar
  • 173
1 vote
3 answers
7k views

publish_post hook isn't working for scheduled posts

I had a bit of an issue with wp-to-twitter publishing a tweet linking to a post that was set as 'pending' that i had emailed to my wordpress.org site. The email included a footer, which included my ...
user avatar
27 votes
4 answers
36k views

Manually set global $post vars with an ID, in order to use template tags

I have a function retrieving ID's of posts by very specific means. I need to be able to set the global $post in order to use functions like the_content(), which does not allow an ID as a parameter. ...
Mild Fuzz's user avatar
  • 4,190
22 votes
4 answers
12k views

Show a different number of posts per page depending on context (e.g., homepage, search, archive)

In the Reading Settings, there is place to set the number of posts shown that affects the number of posts shown in all contexts. I'd like to show instead a certain number of posts on the homepage, and ...
Doug's user avatar
  • 1,049
5 votes
1 answer
4k views

How Do I Use The Wordpress Plugin Posts 2 Posts by Scribu?

I have a Wordpress site that relies on relationships quite heavily. It's a record label website where artists can be related to tours, reviews, album releases and store items throughout the site. I ...
Dwayne Charrington's user avatar
2 votes
2 answers
2k views

Fastest way to loop through all posts?

I need to run a background process in a plugin that does some work on ALL the posts in a person's database once the plugin is installed. I'm very new at working with wordpress so my research has shown ...
Thirlan's user avatar
  • 341
1 vote
1 answer
555 views

Publish Post After Click On A Link

I have a frontend posting form (CF7), where user inputs (among other data of course) his email. Now I set the status to pending. What I want is, that the user would get trough autoresponder a mail, ...
M P's user avatar
  • 111
1 vote
1 answer
595 views

Enable comments for post with comments meta box removed

I have created a custom post type in a plugin for a site I'm working on. I'm allowing users assigned a custom role to add/edit/delete the custom post type. I would like to give these users as little ...
Dave Konopka's user avatar
0 votes
0 answers
307 views

Get the last post ID

I'm trying to understand the ID mechanism in wp_posts in WordPress. Whenever I add a product (woocommerce), page, or an image, they are recorded in wp_posts and assigned an incremented id. Let's say, ...
akinuri's user avatar
  • 101
0 votes
1 answer
555 views

How to extract images of post and pages excluding header and logo image in wordpress?

I have tried this code to get all images from media library and i am sucessfully getting the source urls of all the images but now i want to exclude all the unwanted images like logo, header images ,...
user1145009's user avatar
-1 votes
1 answer
82 views

Dynamic HTML not displaying at respective place

Dynamic HTML not displaying at respective place I have a created shortcode in function.php and my code is, function Post_home(){ $data='<div class="cp-seeWrapper"><div class="container">&...
Naren Verma's user avatar
-1 votes
1 answer
2k views

WP get_permalink Return Wrong URL

I have custom post type named: easytask, and the following code is shortcode from plugin to retrieve data from the custom post above ( easytask ). function easy_shortcode( $attr ) { // Shortcode ...
Peter Chimp's user avatar