All Questions
23 questions
-1
votes
1
answer
73
views
Remove action of an external plugin after checking if custom post meta is set
Edit:The problem were 2 folds - somehow the order list I found before indicated wp_head was before wp_enqueue_scripts but that is not the case. Found another more updated one and it is actually right ...
1
vote
1
answer
483
views
Adding custom fields to bbpress reply form
Referring to post "adding-custom-fields-bbpress-topic-form" with link https://wp-dreams.com/articles/2013/06/adding-custom-fields-bbpress-topic-form/,
I want to add custom fields to bbpress reply form ...
1
vote
1
answer
166
views
save_post_{$post->post_type} action firing on second save
I have custom metabox checkbox on CPT in my plugin. I want to fire an action and save new option when I save this post. But no matter how many times I tried it's saving option value only on second ...
1
vote
3
answers
1k
views
How to position user meta data field
I have 1 additional field I want to display on the user profile page (mainly admin users will use this)
I have done it but it is showing up at the very bottom of the page, I want it to sit in the ...
3
votes
1
answer
734
views
add_meta_boxes action with refresh on save
I've created a meta box using add_meta_boxes action and it works when I open any post to edit it.
add_action('add_meta_boxes', function() {
add_meta_box(
...
);
});
When WP auto ...
0
votes
1
answer
262
views
Woocommerce add a text field if specific option is selected
I need to make active/visible a new filed before 'Add to cart' button, only if user select a specific option.
The case is simple: I sell t-shirt with options: "Small", "Medium", "Large", "Size upon ...
0
votes
1
answer
280
views
Remove meta box except on category pages
To disable custom fields except on category pages, how would I check if it's a category page?
Maybe it would be like this:
add_action( 'admin_menu', 'remove_custom_fields' );
function ...
1
vote
3
answers
5k
views
How to remove the "+Add Category" button from the Category metabox?
I would like to disable the "+Add Category Button" under the Category metabox so that anyone creating a post has to choose only from the list of existing categories.
I did check out another post, ...
0
votes
2
answers
461
views
Use remove_meta_box conditionally on custom post type
I have a custom post type of people with some custom taxonomy boxes, i want to hide these when on child pages. I have found remove_meta_box works fine but i just can't access the $post object within ...
0
votes
0
answers
210
views
do action inside a class is not working
I am trying to create my custom hook and call it from within a metabox class. Here is the pattern:
metabox.php
--
<?php
require("libs.php");
require("test.php");
class metabox() {
function ...
3
votes
1
answer
202
views
Theme elements not translating
Ive got a theme that is set-up for translating but didn't come with any translations. I used poedit to automatically detect the strings, and subsequently translated it in full. However certain ...
4
votes
1
answer
2k
views
Add custom buttons with custom actions in Edit Post screen in WordPress?
I am creating something for a client and I have a Class that I created with a Custom Post Type called 'PuSH Feeds' and when the user adds a new post and publishes it they can then click on one of two ...
0
votes
1
answer
681
views
Adding to an array & passing it through do_action/apply_filters
For exercise I am working through a PHP class to add meta boxes I found on GitHub. I just copied the code and now I am playing around with it to understand it.
It works like this: The file ...
2
votes
2
answers
4k
views
remove_meta_box for all post types doesn't seem to work
To remove a metabox from all post types at once, using a foreach seems like the logical thing to do. However it doesn't always work and I don't understand why.
For examlple viewing the "Post" post ...
1
vote
1
answer
845
views
Add custom action in post type
I use the http://www.deluxeblogtips.com/meta-box Metabox plugin and I want to add a custom action in a post type like the publish button ? when admin click on this button I want to send an email to ...
1
vote
1
answer
2k
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:
&...
1
vote
0
answers
123
views
How to prevent further updates of custom meta when using actions to set one meta based on another
I'm using rilwis' Meta Box plugin (see https://github.com/rilwis/meta-box) to add custom meta boxes to a custom post type.
I then want to populate one piece of meta data based on the value of another....
3
votes
2
answers
9k
views
Why is `add_meta_box` not working?
I'm trying to add some meta fields to a WPSC product using the following code:
/**
* data callback
*/
function abc_callback($object, $box)
{
echo 'callback executed!';
}
/**
* add custom ...
0
votes
1
answer
4k
views
prevent post submission
I'm using a meta-box for custom post type. I have three problems:
WP seems to run the function that I attached to the "save_post" action, every time a new post is opened for editing or reloaded. Is ...
4
votes
2
answers
2k
views
Better way to enforce category hierarchy in post_categories_metabox?
The objective is to ensure that when editing a post, the metabox that lists a hierarchical taxonomy doesn't reorder itself upon Update to put checked items on top.
Right now, edit-form-advanced.php ...
3
votes
2
answers
1k
views
Why can't I hook into save_posts after admin_init?
I'm trying to hook into the "save_post" action from an AJAX callback in my plugin, but it doesn't seem to work. In fact, hooking into "save_posts" only seems to work from a few key action execution ...
0
votes
2
answers
839
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 ...
5
votes
1
answer
4k
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 ...