0
votes
1answer
30 views

Hook only specific post type

with this function I change the title of my posts in the posts type 'alternatives'. My problem is that Wordpress changes all my titles now. Does anyone know how I can set this for the specific custom ...
0
votes
0answers
45 views

Populate WYSIWYG field with ACF choice

So, I have a custom post type that uses a flexible content field containing a post object field and a wysiwyg field. The post object is to choose a post from a selected post type. After you choose ...
1
vote
1answer
26 views

Posts are duplicating on wp_post_update

I have stucked in writing a simple function that on certain page update refresh all posts in a custom post type. Here is my code (based on this): add_action('save_post', 'bulk_refresh'); function ...
1
vote
0answers
47 views

How can I register a hook for all Custom Post Types that are published?

I'm developing a plugin. I want that when every Custom Post Type is published, a hook is called (where I send an email notification to the administrator). I know I can use: ...
0
votes
1answer
23 views

How do I amend form data before it is saved for a custom post type

I have a custom post type for clinics which has 3 fields; a textarea for the address of a the clinic and two textboxes for latitude and longitude. I want the user to enter the address in the textarea ...
0
votes
2answers
38 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 ...
0
votes
0answers
47 views

Redirect to custom post type admin page after wp_trash_post

I currently have a custom post type (enquiries) with a custom metabox which displays the date(s) for that enquiry, these are saved as metakey key value pairs, there can be one or more. the metabox ...
0
votes
1answer
35 views

Add information above a custom post type listing of all posts page

Ok, that sounds like a rather confusing title, let me explain. I have created a custom post type (CPT) and I want to add some summary information about the posts of that post type above their listing ...
0
votes
3answers
109 views

Add a custom text to admin footer in a Custom Post Type page

I want to customize the footer text in a Custom Post Type admin page. I have a plugin that creates this custom post type and want to add in it a function to customize admin_footer_text. As you can ...
1
vote
2answers
70 views

remove_action conditionally for Custom Post Type

By default, my theme is showing an author box below my posts. I am using a custom post type, and would like to remove this author box only on this post type. Here is how the theme is calling the ...
0
votes
0answers
70 views

Hook custom post type (ai1ec_event) to update transposh language

I'm using All-in-One Event Calendar and Transposh on a website that is designed to import content from websites all over the world, and automatically translate them. Right now any event that is ...
0
votes
0answers
41 views

Custom post types ordering & hooks

I have archive-member.php copy/pasted from the archive.php which I use to output the list of all posts with custom post type member taxonomy-meber_type.php file copy/pasted from the ...
2
votes
1answer
126 views

Admin Post Update Redirection to Posts Screen

Is there a hook I can use that when a post is created or updated it goes back to the list/table page of all the posts. If it is also possible to target a post type as well that would be cracking. ...
-1
votes
1answer
90 views

add comments custom fields after user is logged in

I want to add two custom fields inside comments on a CPT after the user is logged in on. This is the code for creating the custom fields: function debate_comment_fields( $fields ) { if( ...
0
votes
1answer
62 views

comments hooks on custom post type

First, this is what I want to achieve: I want to add a comments hook on a CPT which is asking users to be registered and logged in to be able to post a comment. And after the user is logged in to ...
0
votes
1answer
244 views

Add an Outside Wrapper to my Header and Make it Full Width

I did reposition the <header> outside the 'wrap class' class by adding this function in my function.php /** Reposition header outside main wrap */ remove_action( 'genesis_header', ...
1
vote
1answer
1k views

Custom Blog Post Listing in Genesis Sample Child Theme

I want to add several images and divs and also customize the look of my Blog post listing... But i can't find the way to do it. Here's the Blog Template code <?php /* WARNING: This file is ...
2
votes
2answers
414 views

How to create notification on frontend using heartbeat api for multiple custom post types

How can I get correct action hook on publish_posts for multiple custom types ? I have a following problem, I can use this hook for posts or single custom post_type, but I don't know correct hook for ...
0
votes
0answers
65 views

Creating a new post every time an image is uploaded

I'm making this question because the one I found by searching seems not to work. I have a custom post type project on my theme. When I upload an image via the media library in the wordpress backend I ...
0
votes
1answer
127 views

How can I add a filter to a particular post format?

I have several post formats and I want to use add_filter selectively, applying the filter to some of the post formats but not all. When I do this in my functions.php file it affect all the post ...
0
votes
1answer
263 views

Catch and display error on save_post action

I wrote this function that adds data to an external db every time a custom post called 'event' is created. How can I prevent the save from happening if this function returns an error? At the moment, ...
0
votes
0answers
51 views

getting a post id from a custom type post

changed a wordpress to use custom type posts instead of pages. I'm Trying to update a plugin to work with this change. currently I'm stuck with just getting the right id from the post here's the ...
0
votes
1answer
41 views

Hooking in to an archive page?

I'm making a custom post type that I want to use in the form of a plugin - all pretty straight forward. However, I want the archive page for this post type to look slightly different in the content ...
1
vote
0answers
225 views

get_query_var() not working in pre_get_posts

I'm using the pre_get_posts hook to order the main query on all my custom post type / taxonomy pages using a custom meta value. As part of the logic, I am trying to determine which taxonomy is ...
3
votes
2answers
508 views

How to Debug the 'save_post' Action?

Is it possible to validate PHP code? I have a Custom Post Type (Film) with Custom Meta Boxes. Everything is working fine, I can add new Films and details to the Custom Meta Boxes. My problem is ...
3
votes
3answers
3k views

Hook for post and page load

I need to run a function when a particular post or page is loaded. Is there any hook that lets me check whether a post is being displayed during page load ?
1
vote
2answers
159 views

Creating a function that receives the taxonomy terms that have been changed in a custom post type

Ive been looking into actions and hooks etc... from wordpress, but cant seem to do a very simple thing. I just want to execute a function whenever a post is updated, and within the function I want the ...
0
votes
1answer
242 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 = ...
1
vote
1answer
495 views

Add custom column in custom post type edit page

I am using the Content Scheduler plugin to control the post expire. The plugin will add a expiry date column on the wp-admin/edit.php in page and post. However it doesn't show in custom post type page ...
7
votes
3answers
4k 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()){ ...
2
votes
2answers
1k 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
1k 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} ...
10
votes
5answers
2k views

How do you use a CPT as the default home page?

I have a client who's site will be making heavy use of custom post types to configure their site. But I'm between a rock and a hard place for their requested home page. In reality, the home page ...
0
votes
2answers
560 views

How to recover the post ID earlier in the WP admin hook action “firing” sequence?

I am creating a WP plugin based around Custom Post Types (CPT), where you can dynamically specify a CPT, complete with any number of associated dynamic Meta Boxes and form elements such as radio ...
2
votes
2answers
544 views

specify meta_key / meta_value condition for prev_post_link and next_post_link

I've got a custom post type (CPT) called event. Every event has got an associated meta_key called event_date. I want to make sure that events with empty event_date won't appear in my list of all ...
6
votes
3answers
4k views

Calling a Function After New Post Creation for a WordPress Custom Post Type?

Assume I created a new post type 'product'. Is there a way to perform a function (user created) when this new 'product' post has been created?
6
votes
3answers
1k views

Making Custom Fields Standard in the Admin UI

I've added a few different custom_post_types to my Wordpress 3 installation. They are all a bit different from eachother, and should store unique information in custom_fields. But while one may store ...