0
votes
1answer
21 views

Loading plugin text domain before registering post type

I'm building a wordpress plugin, that will register a post type. Im trying to set up a simple test case where all it does is registering a post type with get text functions and translating it with ...
0
votes
1answer
59 views

Include php on a specific page template

I'm using a 'specialized' page template called 'page-courses.php', following the codex: http://codex.wordpress.org/Page_Templates#Specialized_Page_Template In my child theme's functions.php I want to ...
0
votes
2answers
73 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 ...
1
vote
1answer
96 views

Remove “Get Shortlink” button in admin of custom post type

I want to remove completely this section under my title in my custom post type. (I don't need this because I use this only for content management). With this piece of code I can remove the ...
0
votes
1answer
69 views

wp_trash_post action hook with custom post type

When a 'contact' cpt post is trashed, i need a metakey from another cpt 'act' to be deleted, i have been searching all over which hook i should use but unfortunatly the codex action reference page is ...
0
votes
2answers
115 views

action init hook and get_post_types

Why if I register a custom post type by add_action( 'init', 'custom_post_type' ) hook it doesn't show in returned array by get_post_types function? Example: function test(){ $args = array( ...
0
votes
0answers
21 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' => ...
1
vote
0answers
64 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
37 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
1answer
62 views

How can I get some of a posts meta data whilst it is still inserting?

I'm trying to make a function where a child post of a certain post type inherits the same title and slug as its parent. I'm using WP Types to define my post types and their relationships. But I'm ...
0
votes
1answer
107 views

add_action 'init' from inside a class for custom post types

I'm trying to create archive pages for my custom post type. I create custom post types from within custom classes: functions.php include_once(get_template_directory() . '/admin/admin_init.php'); ...
0
votes
2answers
56 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
65 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 ...
1
vote
1answer
751 views

update_post_meta() whenever custom post type is updated

I need the following functionality. Whenever my custom post type is updated or saved I need to overwrite certain custom post metas. I need to make sure this only affects posts of the post type ...
0
votes
0answers
33 views

Custom meta boxes for different custom post type on multisite WP

I have two custom post type defined ('acting' and 'voiceover') and custom met boxes defined for both of them. I'm able to save, update and delete on the acting custom post type. But if I add the ...
0
votes
3answers
191 views

Using preg_replace to filter custom textarea

I am developing a custom post type, which, among others includes the possibility of sending an email from within the post editor. The email body textarea is populated through a custom settings page ...
0
votes
0answers
6 views

Adding custom taxonomy term on post_save for custom post type [duplicate]

I have a custom post type called course and a custom taxonomy called courses. What I am trying to achieve is that when a user creates a Course post, it automatically adds the post title as a Courses ...
0
votes
1answer
87 views

Add html to cpt main page / admin edit.php

I want to add some html under the title of a custom post type I created. See area in image here: http://i.stack.imgur.com/rpkV3.png I tried using different methods including post_row_actions ...
0
votes
2answers
236 views

remove custom post type permalink

I've registered post type with following -- $holidayLabels = array( 'name' => __( 'Holidays'), 'singular_name' => __( 'Holidays'), 'all_items' => __( 'All Holidays'), ...
0
votes
1answer
82 views

What is the proper way implement a global $wp_rewrite?

The below code works correctly, but I don't know if it is proper coding. Can anyone confirm or comment on the code? add_action('init', 'news_rewrite'); function news_rewrite() { global ...
-1
votes
1answer
77 views

What do the numbers mean at the end of add_action('save_post')…?

I've seen on a few tutorials that there are numbers at the end of the call to save Custom Fields/Meta Boxes on the save_post hook. For example, in the WordPress Codex it gives the following example: ...
0
votes
1answer
81 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
3answers
2k views

Custom post type save_post action not firing

Sorry if this is already answered on here. I looked around and couldn't see any answers to my question so I thought I'd post my own. I'm building a plugin for a client that gathers customer feedback ...
0
votes
1answer
486 views

Displaying custom taxonomy in the admin list of a custom post type

I'm trying to list the terms of a custom taxonomy ('genre') in the overview table in the admin area for a custom post type ('station'). To get this, I tried the following code in my theme's ...
0
votes
1answer
57 views

Running a wordpress action when a custom post type term (taxonomy category) is changed

Trying to make a system whereby a function is called upon an admin changing the taxonomy category (term - if i understand correcrtly) of a custom post type. I thought the action tag "edit_category" ...
0
votes
1answer
965 views

Custom post_type search's $wp_query->query_vars do not correspond

I have been having this issue, with integrating events manager among my other post types, where the other custom post types show up in the $wp_query->query_vars array, except for the event manager ...
0
votes
1answer
271 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
661 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
433 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
183 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
2k 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 ...
8
votes
3answers
5k 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
1answer
921 views

Dynamically Create Terms in Taxonomy when Custom Post Type is Published. Almost There!

I'm trying to automatically create terms in a certain taxonomy when a certain custom post type is published. The newly created term must be the name of the post that was published. Example: I have a ...
2
votes
3answers
2k 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} ...
1
vote
1answer
2k views

register_taxonomy and register_post_type does not work

I have a problem using the register_post_type and register_taxonomy on my Wordpress. I created the code on my functions.php and it does not update my panel. Why? //Categorias personalizadas ...
0
votes
2answers
584 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 ...
0
votes
1answer
436 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: ...
5
votes
1answer
2k 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 ...
2
votes
1answer
3k views

pre get posts changing the query

i need to change the posts in taxonomy.php page. I have a meta_key which i want to compare to meta value. But currently my code is not returning anything. I am sure i am missing something. Please let ...