3
votes
1answer
30 views

How to validate XML-RPC post creation and cancel when needed?

I have an IFTTT recipe that creates posts for me on some occasion, but for some weird reason it creates three, sometimes four posts of the same content. I would like to add an add_action ...
0
votes
0answers
12 views

Presetting the link of video attached to a Standard Post Format in a custom field

I am trying to create a function that presets the URL (of an attached video in a Standard Post Format) to a custom field when the post is created using a front-end form. (P.S.: All data inputted in ...
0
votes
2answers
82 views

Create new custom post and post category of same name

I have a custom post type "Product" and want to create a post category "A Product Name" automatically on creation of a new Product so that the post category (not custom post category) would have the ...
0
votes
1answer
67 views

the_posts filter been called multiple time

I have create an endpoint so I can do some checkout processing of my cart. Everything is working fine in sense that every thing is hooked up properly. Though I am having issue that to serve the ...
0
votes
1answer
73 views

How to check if single.php has already called the_post_thumbnail function

I am creating a front end plugin to upload images and adding filter in the_content() to display post thumbnail but some templates already have the_post_thumbnail in single.php or loop.php. Is there ...
0
votes
0answers
23 views

adding access to a specific post in the wordpress admin left menu

I've added a custom post type on my wordpess called "Perso". here is the code : // Register Custom Post Type function custom_post_type() { $labels = array( 'name' => ...
0
votes
2answers
62 views

What hook can I use to modify custom post data before it is displayed on the page?

I need to check if a certain value is true in the post_meta right after the wp fetches a custom post from database, If it's false I need to modify/add some data to the post and then display the ...
1
vote
2answers
67 views

How can i do something after head like adding a hook for after head but before post

What i mean is i am trying to add breadcrumbs to my blog and i thought of adding it before content or after title but there's an issue with that - on archive pages or category pages the breadcrumbs ...
0
votes
0answers
35 views

Action after saving/publishing a post

I want to create a small newsletter plugin, which can send mails out of the edit post page. I will add a metabox, and don't know how to create a button in this metabox which will start my function. ...
2
votes
2answers
730 views

add action only on post publish - not update

I have action which adds meta field with value on post publish. Problem is that when I update post meta field is reset to default value. I already tried 'new_to_publish' instead of 'publish_post' ...
2
votes
2answers
345 views

Custom function for “Submit for Review” hook

So I manage a blog of about 15 contributors and 5 editors. I wanted to implement a system so that each time a contributor hits the 'Submit for Review' button, and email is sent to the editors to ...
3
votes
1answer
232 views

How to add a “publish” link to the quick actions

I'm trying to add a "Publish" link by the quick actions: but I'm not exactly sure of how implement it. Here's what I've got so far: add_filter('post_row_actions', function ( $actions ) { ...
0
votes
1answer
82 views

Dynamically change post_parent in every page load?

What's the correct Wordpress action where I can hook to dynamically change the post_parent of a post? I understand that a post can't have multiple parents so that's the only way I can think of to ...
1
vote
0answers
106 views

Set static page/post from another blog on same network

I have a multisite project and have a small problem with static front page/post. In general i am looking for a way to choose a static page/post out of the whole network on my main blog. Now i'm not ...
3
votes
2answers
432 views

Action hook 'wp' firing twice… why?

I noticed that when I hook into 'wp' it seems to be firing twice -- for example add_action('wp', 'just_testing'); function just_testing(){ global $post; error_log($post->ID); } returns ...
1
vote
1answer
674 views

How can I hook into creating a new post and execute wp_die(), before the post is inserted into the database?

Info about wp_die from codex: Kill WordPress execution and display HTML message with error message. A call to this function complements the die() PHP function. The difference is that HTML will be ...
0
votes
1answer
399 views

how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?

How add_action("manage_posts_custom_column", "custom_callback_fun01"); relate to add_filter("manage_{xxxx-xxx}_columns", "cusotm_callback_fun02" );? How do they both work together? By using these ...
2
votes
2answers
71 views

Is there an action that is called when a post is restored from the trash?

I'm looking at the wordpress list of actions and trying to find an action that is called when a post is restored from the trash but cannot find one. Does anyone know if it exists?
1
vote
1answer
268 views

Count singular post views automatically

I'm trying to add some function to each loop called in the themes. What I'm doing is I add a function to count post view from here post views without plugin, to use the function I need to add this ...
1
vote
0answers
80 views

Copy post to separate database with “add_action(…)”

I'm basically trying to have a copy of a post be sent to another database's table when it's published. I've gotten it to add a new row in the new table, with my own static arguments, but I'm not sure ...
0
votes
2answers
283 views

Divs appearing everywhere in post content

Whenever somebody writes a post on our site, the Paly Voice (http://palyvoice.com) there are automatically a lot of <div> elements created. This is bad for layout, since we have a style that ...
4
votes
1answer
949 views

Create posts on user registration

How can I create let say 3 posts after the user finish the registration ? The ideal outcome would be to create 3 posts using the user as the author of the posts and with some pre-defined values. ...
-1
votes
1answer
89 views

Action while post is being published

I modified the wordpress admin with a plugin I wrote, and my last problem is that there's no action anymore while the post is being updated or published in the admin. I looked around for a function or ...
1
vote
1answer
736 views

Get the post_id of a new post

There are several ways to get the id of a post after it has been saved (auto, etc.), but is there a way to get the post id immediately after you create a new post? I am trying to create a directory ...
0
votes
2answers
1k views

Get post id in wordpress action?

I have this code add_action( 'delete_post', 'my_delete_function' ); function my_delete_function() { global $wpdb; $wpdb->query(" DELETE FROM wp_votes WHERE post=".$thePostID." ;); } ...
0
votes
1answer
1k views

add_action not using 'delete_post' action with wp_delete_post

I am using wp_delete_post function to delete the selected posts shown on the front-end (in my theme page). Posts are being deleted successfully. // delete all selected posts foreach( ...
3
votes
3answers
2k views

How to publish a post with empty title and empty content?

Why I'm doing this you might ask? I'm developing a website for a business with a portfolio where the gallery items are posts. These posts are populated through custom fields and category selections, ...
0
votes
1answer
65 views

Actions to use when flushing cache (when posts are added / deleted / modified)

I'm looking for a list of action tags that are relevant when you: create a post, with any method, so basically using wp_insert_post modify a post, like changing status, title, content, terms, meta, ...
1
vote
1answer
2k views

Create cron job without a plugin?

Basically I wrote a function that lets me change the post status to draft depending of a field in the postmeta table: /** * Remove ads if they have been sold for over 5 days */ function ...
5
votes
2answers
3k views

Function to execute when a post is moved to trash .

Hi is there an action which can be performed while a post is moved to trash .... I tried delete_post and deleted_post. It works but twice for each action ( before and after the action as written in ...