Tagged Questions
0
votes
1answer
36 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 ...
0
votes
1answer
147 views
Create action running on trashed_post hook to modify post_meta value
I have a custom post type that always do math operation to its post_meta and other custom post type post_meta.
For example:
post-type 1 = cpt_product_order
post-type 1 post_meta = ...
4
votes
1answer
294 views
How to change “Draft” string for status of custom post type to “Unavailable”?
ANSWER MOD: just an important mod to the chosen answer:
// check if you actually have drafts; also avoids extra '|' separator
if (isset($views['draft'])) {
// 'Drafts' should be added (and come ...
-1
votes
1answer
218 views
publish_post action doesn't work
i'm developing a small plugin which will send email to users when a new magazine is published.
i made a post type name "magazine" on the theme functions.php.
and i wrote a plugin for email ...
1
vote
1answer
138 views
Can taxonomies of custom post types be used with category actions?
I need to create a hook after the creation, edit and deletion of a taxonomy organizing a custom post type I have. I've noticed though that I can't use the following actions with those taxonomies:
...
3
votes
3answers
1k views
How to correctly get post type in a the_title filter
I want to prepend text to the post titles of a specific custom post type, but the filter below didn't work. Instead of changing only that CPT's post titles, it changed all titles on the given CPT's ...
6
votes
3answers
2k views
How to enqueue scripts on custom post add/edit pages?
I'm trying to enqueue a JS script only when someone is adding or editing a custom post type I created called "recipes". Currently the script works ok when I do this:
if (is_admin()){
...
1
vote
2answers
825 views
Unregister post type from child theme
I'm trying to unregister a post type from a child theme but I haven't been able to do so, the code in the funcions.php file on the parent theme is something like this:
add_action( 'init', ...
1
vote
2answers
904 views
What hook should be used to programmatically create a post only when master post is updated?
Pippin and Jean-Baptiste Jung have very good tutorials on how to programmatically create content when a new post is published using these four actions hooks...
publish{post_type}
...
0
votes
1answer
377 views
Custom post type functions.php if statement on action
I am using developing a child theme for Woothemes' Canvas.
I am trying to use functions.php in the child theme to only use actions on my custom post type.
This code doesn't seem to be working:
...
4
votes
1answer
1k views
Action hook on Edit custom post type?
Is there an explicit action hook that will fire when (or just before) the admin Edit page renders for a custom post type? Something similar to {$new_status}_{$post->post_type}?
I'm trying to find the ...