Tagged Questions

Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
1answer
74 views

save_post not working

In order to create (or update, whenever a post is updated) a unix-timestamp meta, I used following code to fire on save_post. I pasted this code in functions.php. But I believe this is not working, ...
1
vote
1answer
40 views

When does a function assigned to the content_filtered_edit_pre filter hook fire?

I added a function to the filter hook tag 'content_filtered_edit_pre', but it doesn't seem to fire no matter what I do. I am also aware of 'content_edit_pre', but I am curious as to when this filter ...
0
votes
0answers
43 views

Plugin constructor called multiple times

I have plugin with the following structure - class emailPlg { static $tableName; static $pluginDbVersion = 1.0; function __construct() { global $wpdb; ...
3
votes
1answer
138 views

Check php version before theme activation

I've got theme that requires php 5.3+ version. If older - fatal error occurs with it. So what I need to do when user try to activate this theme is to check php version before going into theme code ...
0
votes
1answer
57 views

How do I remove an action hook by s2member

I noticed that my plugin doesnt work when s2member is activated but unfortunately it is needed for the site functionality, i did some research if I comment out this line on hooks.inc.php then my ...
0
votes
1answer
30 views

Renaming wordpress login and get new password button

I am currently building custom wordpress admin login theme.Now I have an idea but not sure it is possible.I want to rename "Get New Password" to something "Get New". Is it also possible to rename "Log ...
0
votes
2answers
118 views

Why I can't load my JavaScripts using an hook inside my functions.php file?

I am pretty new in WP (I came from Joomla) and I have the following problem: I am carrying this pure HTML theme (that use BootStrap CSS framework) into a WordPress theme. This is the original pure ...
0
votes
1answer
65 views

Removing action from template class

I'd like to replace an action in a theme with my own version in a child. In this case, the theme hooks into wp_head to add it's own links. My own functions.php resides in the child theme and looks ...
1
vote
1answer
131 views

Filter or action hook to insert content on admin pages before </body> tag

I am developing an administrator plugin and want to be able to write some HTML content just before the last body tag . This content will initially be hidden then displayed with javascript when a user ...
0
votes
0answers
37 views

How to re-run the main query based on meta data value?

When a user requests a custom post url like */books/best-book-eva, I want to (with a plugin) hook in before the page is displayed (and the main query run if possible) check that posts meta value ...
0
votes
1answer
38 views

fire action when post is being edited as well as saved?

I'm trying to fire some code when a page is edited and/or saved. This code works: add_action( 'save_post', 'add_promoted_meta_data' ); function add_promoted_meta_data( $post_id ) { echo ...
0
votes
2answers
68 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
98 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
68 views

Redirect logged in users if they are on a specific page

I'm trying to prevent a user access besides the admin to the registeration page and reset password page if they are already logged in. I have the following: function redirect_loggedin_users() { // ...
1
vote
1answer
804 views

Problem only while using require_once() within functions.php

I use add_theme_page() within my child theme's functions.php implemented something like this... // other functions located here that create a custom options page in the Dashboard. // THIS IS NOT A ...
0
votes
1answer
55 views

What happens when two or more plugins use the same hook?

Two of my plugins use the same filter hook: the_content. What happens in this case? Is there a priority handler, like which plugin will be served first? I would like to use both of the plugins. I ...
0
votes
1answer
48 views

Which hook should I use for this scenario regarding the registration process and account/profile update?

I would like to run a PHP script "ONLY" when a user successfully fills out the WordPress Registration form and submits it as well as when a user updates their profile. Here's what I have so far, ...
0
votes
1answer
49 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 ...
1
vote
0answers
70 views

I have 2 plugins using the same wp_login action hook and one is not working

so this is after a few hours investigating, I have s2member plugin and a custom plugin what happens is they are both using wp_login hook in this manner, s2member: add_action("wp_login", ...
0
votes
1answer
62 views

Single-level menu option? Another way?

I'm developing a child theme of Twenty-Thirteen for a client. My theme contains a second navigation menu properly registered through my functions.php file. This second navigation menu is fully ...
0
votes
2answers
27 views

How to change value of $menu_class in ep_nav_menu?

How can i change value of $menu_class parameter in wp_nav_menu() so that I can give a special css class to one of items in menu for example "Home"? here is some code but they didn't show me the ...
0
votes
0answers
36 views

How to change style a menu item in plugin?

I want to assign specific style to a specific item in navigate menu like "Home" but in plugin not in theme. I think I must write something like this in my plugin: function change_home(..){ if($item ...
1
vote
2answers
264 views

Hook for post permalink update

I would like to know what hook should I used when the permalink/url of a post is modified. My goal is to get the old permalink and new permalink so I can used it for my plugin. Thanks. [EDIT] Just ...
0
votes
1answer
44 views

Is this hook really deprecated? ( manage_{$taxonomy}_custom_column )

I've been adding some data to the columns of two taxonomies in a theme I'm working on. I've hit something that's got me confused though. I'm using this hook manage_{$taxonomy}_custom_column but the ...
0
votes
1answer
100 views

WPMU Hook for archive or deactivate blog?

I am trying to automatically clear the blog's cache when it is Archived (or Deactivated is fine) in a Multisite install. This is useful for anyone using a caching program like WP Super Cache as an ...
0
votes
2answers
1k views

Reposition Woocommerce Message

I'm trying to reposition the messages in my Woocommerce theme. For example the successfully added to cart message. They appear to automatically be placed at the very top of where the woocommerce ...
0
votes
2answers
295 views

Dynamic menu links after header title

I am using Parabola theme of Wordpress, and i would like to display few dynamic menu links for logged in users, just at the right of the header title. As shown in the below image, Menu 1 and Menu 2 ...
1
vote
3answers
454 views

Hook Widget to Woo Theme in functions.php

Right now I am adding a sidebar above my woocommerce products. How can I hook the sidebar to my theme. Have registered sidebar and it works. register_sidebar( array( 'name' ...
0
votes
1answer
453 views

what is the action hook code to supporting product category condition in single product page of woocommerce?

I want to display product attributes of 2 different product category with the help of conditional tags. But the condition was not working This is the condition that i given ...
0
votes
1answer
84 views

can't access dashboard and showing forbidden page

i cant access my dashboard. after i make true the wp-debug it shows the following error. Notice: wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued ...
0
votes
1answer
45 views

Display taxonomy with a maximum number of letters

I'm looking for a function which displays a post's taxonomy with a maximum number of letters. I've achieved with title (How to limit the max number of characteres in the title that are displayed), but ...
2
votes
3answers
248 views

how to limit edit_form_after_title hook to page and post edit only?

heelo, I want to use this great hook edit_form_after_title it was announced on December 1, 2012: http://make.wordpress.org/core/2012/12/01/more-hooks-on-the-edit-screen/ it curreclty hook for : ...
1
vote
2answers
88 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 ...
1
vote
0answers
59 views

Add custom text in the media library image meta area

I want to add some custom text in this area in the media library: Is there a filter I could hook into or how can I add content there? If not, how do we do this using Javascript? I want the text to ...
3
votes
1answer
70 views

Disallow a user to post in certain categories

I am writing a plugin that will disallow user to post in certain categories. I am trying to display an error message to the user when he tries to post in the restricted category and also want WP ...
0
votes
1answer
70 views

How To Make Sure That My Action Hook Executes Last

How can I make sure that my_function action hook on 'wp_head' is executing last? One hack, that I'm using, is to give 999999 (a big number) as the third argument. But maybe some other hook on ...
0
votes
3answers
266 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 ...
0
votes
0answers
79 views

Problem importing posts (get_categories is empty)

I want to import posts through an RSS plugin and events through a calendar plugin, and then have these plugins set the category for these imported posts. Then, using a hook (see code below), I want to ...
-1
votes
1answer
204 views

How to hook wp_mail to add a custom email as BCC for each sent email?

Is there a way to hook into the wp_mail function to add a custom email as hidden (BCC) copy to each email sent? If so, how? -edit- It's not like I want to send an email with BCC, I would like to ...
1
vote
1answer
122 views

What filter should I use to insert a button inside on Media>Add New

I am adding a new way to upload a media file to WordPress. So I am looking for a way to add a link or a button to the Upload New Media page. What is the recommended filter? Or is there another better ...
1
vote
1answer
2k views

Customize user account activation message

During the process of a user creating a new account, once they click on the link in the activation email, they receive the message on the login page: Your account is now active! Username: ** ...
1
vote
2answers
138 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 ...
1
vote
1answer
103 views

Get current page_id before loop, in functions.php

In the Shoestrap theme, you often change content by using hooks. I want to add the following to functions.php but it doesn't work... // in functions.php if ( is_home() ) { add_action( ...
1
vote
1answer
83 views

How can I find the hook I need to rewrite a function?

I want to change the behavior of a bbpress/Buddypress "create group" page. I found the function I need to rewrite, it's the function create_screen in ...
0
votes
1answer
73 views

Is it possible to track down Actions and Filters?

As far as I know using Actions and Filters hooks is the best approach for developing on WordPress. I have just to ask if there is any way to track down which Actions and Filters are applied on ...
1
vote
1answer
73 views

Question about how do wordpress filters/actions work

I have a question that I'm curious. In WordPress we can add a filter or action like this code: add_filter($filter_Name, $function_will_be_hook); add_action($action_Name, $function_will_be_hook); ...
0
votes
0answers
136 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
1answer
54 views

preg_replace not removed “class”

Use this code to remove the label "class" of the images, but does not work. The label does not disappear in the new post. function the_post_thumbnail_remove_class($output) { $output = ...
0
votes
0answers
69 views

Remove “enqueued” script from array

Im working on optimizing a child theme for a site and the parent "has more than we need" Lots of requests being generated all adds up to performance hits. What I'm trying to accomplish is this effect ...
1
vote
3answers
606 views

How to get url of a post from admin panel

I want to get post url from the back end edit post page, the edit post url is : www.ddd.com/wp-admin/post.php?post=1&action=edit the real post is: www.ddd.com/wp/?p=1 since the user can edit ...