Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

1
vote
1answer
99 views

Should I use function_exists() and/or add_action() in theme development?

I'm trying to get my theme ready for publication on WordPress.org I got this feedback: function_exist() it is not preferable 3.0 design Now I wonder what I'm doing wrong. In the current ...
0
votes
0answers
13 views

Bulk img-rename images in gallery

I'm trying to add the content of some text-fields to the selected images of a gallery. I found out, how to create the input-fields. My problem is to get the content of the text-fields and write it to ...
2
votes
1answer
8k views

How to customize woocommerce related products?

I have the following lines of code in my website that will display the related products at the bottom of my single product page in WooCommerce... functions.php: // display upsells and related ...
0
votes
0answers
72 views

Making Site A Use Site B's wp-content Folder

I'm trying to synchronize two WordPress sites and on my way I've faced few challenges. One of the challenges is to either synchronize the wp-content folder of two sites or make one site use the ...
-1
votes
1answer
117 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
170 views

Is it possible to create an action hook using do_action() within add_action()?

Is it possible to create a new action hook like do_action('my-hook-name'); inside a call to add_action();? I'm aware this code doesn't work, but I was thinking something along the lines of... ...
0
votes
1answer
86 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
72 views

How can I add a default description to uploaded files?

Is there a way to add a default description for media files as soon as they are uploaded to WordPress? Specifically, I want to modify the code here to extract the text from PDF files and include it ...
0
votes
1answer
373 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', ...
3
votes
1answer
2k views

How to create thumbnails for PDF uploads?

I'm developing a website that needs to allow users, within Gravity Forms, to submit a PDF file and have a JPG thumbnail created of the first page of the PDF that is then displayed in the created post. ...
1
vote
1answer
102 views

Lock user information once fields have been filled in

Much like the username is locked down and cannot be changed once it has been registered, I would like to lock down additional fields I have created with Advanced Custom Fields like the person's ...
0
votes
1answer
297 views

How to pass a special CSS class into widget li

I have assigned a Sidebar into functions.php: register_sidebar( array ( 'name' => 'Footer Widgets Area', 'id' => 'footer_widgets_area', 'description' ...
0
votes
1answer
30 views

How to create and use Custom hooks

I am newbie in wordpress. I have just created contact us plugin for my own project. In my plugin I have used many functions you can take a look of my code. I want to make this plugin based on custom ...
0
votes
1answer
143 views

Add content after get_header

I'd like to add content directly after the div#main (end of header.php) and before /div#main (beginning of footer.php). I'm using an own child-template (of twentythirteen), that contains only ...
0
votes
0answers
197 views

Gravity forms - gravity form hook for multi-page forms

I have a multi page form that I would like to hook into. On the final page of the form, after submit, I would like for the confirmation to appear as a lightbox over the contents of the final page, ...
1
vote
2answers
146 views

How to trigger the core WPLANG to make automatically set a language when the theme is activated? [duplicate]

I'm developing a theme especially for Bānglā blog posting, and it'd be under GNU license. I questioned about a Calendar Widget translation with some problems today, and got a comment saying: I'm ...
1
vote
1answer
64 views

How to hook some Unicode texts into calendar widget safely?

I collected a good numerals replacing function for WordPress calendar: function make_bangla_number($str) { $engNumber = array('0','1','2','3','4','5','6','7','8','9'); $bangNumber = ...
0
votes
1answer
2k views

Using wp_ajax and wp_ajax_nopriv hooks

I want to send an ajax request and want to process it if the user is logged in. Therefore I want to use following two hooks, but I am not sure if I am using them correctly. Is it correct to use same ...
0
votes
1answer
35 views

add_action second argument missing

I don't know what is missing here. I have a do_action() and add_action(). Only the first argument passed, to the function: function testing($a, $b) { echo $a . $b; // Here is just get A, and an ...
5
votes
1answer
1k views

Difference between do_action and add_action

This question might be wrong, I am not sure about it. Because I am not clear on this. I know add_action it is used to to hook our function to the specified function. For example ...
0
votes
1answer
2k views

How to add a new product type on woocommerce product types? [closed]

I want to add a new custom "product type" to woocommerce plugin: Tried to duplicate one of currently exist product type files (woocommerce template structure) as a new file (file name and inside ...
0
votes
1answer
31 views

Change permalink when page category selected in admin

I'm using the Events Manager plugin which uses a custom post type of 'events' and a custom taxonomy of 'event-categories'. One of my events categories is 'Short courses'. When I check this category ...
0
votes
0answers
81 views

functions.php conditional output for a single plugin

hope I've asked this correctly. Bizarre situation. I have some non-breaking spaces in my titles for typography reasons. They are added automatically where required in place of normal spaces by the ...
1
vote
1answer
106 views

Add Lightbox To WordPress Native Gallery

Is there a way to check if a gallery is linked to an attachment page or to an image file via jQuery or WP filter? I'm trying to add a lightbox to gallery image that is linked to image file. But I ...
1
vote
1answer
41 views

Inserting above the comment template

I want to insert content, just above the comment template.I have tried all the word-press filters and hooks but failed. I want to insert the content above the comment template, I mean above all ...
1
vote
1answer
143 views

Change the footer text on the login page

I am customising the login page and would like to alter the footer text that takes the user back to the website. Ideally and as an example, changing it from the first image, to the second just below: ...
2
votes
1answer
593 views

Which hooks is this? add_action('wp',

I have seen it here: wp_schedule_event Code snippet: add_action( 'wp', 'prefix_setup_schedule' ); I couldn't find this hook anywhere in documentation, how does it work?
0
votes
1answer
77 views

Hook into create_category

I'm trying to in some way hook into when a new category is created. What I would like to do is to see the term and slug that was created and log them/email them. I have tried to hook in to ...
0
votes
1answer
210 views

How to add description over forum list on bbpress root page

I have few forums added for bbpress and when displaing root page I have them listed. Now I want to add some description at the top to provide some intoruction to visitors. Does anyone know how to do ...
2
votes
1answer
389 views

Delete option value from array using update_option()

I have a user profile field which subscribes the user to forum posts by email. This adds the user's email address to an array in wp-options. Naturally I want the user to be able to unsubscribe, in ...
0
votes
1answer
148 views

Admin Hook at the Login Page

I need to write code before user can enter username and password. So, I have code written just after the following line in wp-login.php page: $action = isset($_REQUEST['action']) ? ...
0
votes
1answer
144 views

How can I do customizations on login, registration and password recovery forms?

There are a couple of answers here basically just linking to a plugin - to be fair there are some more specific ones too. I know there are many possibilities to use different hooks for the ...
0
votes
2answers
98 views

How to hook in to the “output buffer” and add html content

I want to be able to hook into the output buffer flow and add some conditional content to my WP pages. What I want to do is test cookies and display a semi-transparent screen with a content box based ...
0
votes
1answer
309 views

WordPress RSS feed - filter RSS content by custom field value

I can have the RSS feed url like: http://www.mydomain.com/?post_type=job_listing&job_cat=value#1&job_type=value#2&geo_country=value#3&feed=rss2 job_cat & job_type are taxonomies ...
0
votes
2answers
430 views

How to hook into user registration process Before user registers

I need to add a field to the user registration form and then validate it before I add a new user to my WordPress I know how to hook into the registration form via add_filter('register_form', ...
6
votes
2answers
296 views

Wordpress and event-driven programming - what is it about?

I want to state very clearly that this does not intend to revive the discussion about functional/procedural programming versus object-oriented programming. There is plenty said about that, on WPSE and ...
0
votes
1answer
26 views

Is there a way to change select-list for new custom taxonomy?

When you add a category in the admin-panel, the adminstrator can select it's parent. Something like: - Category1 -- Subcategory1 to Category1 -- Subcategory2 to Category1 -- Subcategory3 to Category1 ...
-1
votes
2answers
311 views

How to pass hook variable to function?

I have a function that has an add_action inside it that calls the user_register hook. I would like to be able to echo the variable $user_id from the user_register hook and the $_POST array as well. ...
0
votes
1answer
32 views

Retrieve New user's ID

I'm trying to retrieve the user id of a new user as soon as they're created. I tried using the hook "user_register" but there appears to be no id in there...maybe it grabs the data before a userID is ...
0
votes
2answers
214 views

Conditionally call add_action depending on post_type?

When building a plugin, I know that you can hook into a function to run some code like add_action('admin_footer', array($this, 'custom_function')); And within that function, test for post_type like ...
0
votes
1answer
164 views

save_post not working with attachments

I've made a Meta Box for Posts and Pages, and while testing added Attachments too. But, curiously, the hook save_post does not fire. $cpts = apply_filters( 'my_filter', array( 'post', 'page' ) ); // ...
0
votes
0answers
28 views

Trouble adding data to options table

I am trying to create a function that adds an option containing a subscription list to the options table. (This list is eventually referenced by a plug-in.) I am having some problems as there are two ...
2
votes
2answers
202 views

Can user_register output the password?

I'm trying to output the password of a newly created user in plain text using the user_register hook as explained in this answer. However, upon doing a var_dump of $_POST, I don't see any password ...
2
votes
2answers
2k views

Add subtitle to Woocommerce product title

I'm using WooCommerce on a site built with Pagelines Framework. I need to have a subtitle/customisable field appear under the product name anywhere it appears in the site. As it is, WooCommerce ...
0
votes
1answer
23 views

hook for loading page

I wanted to load my custom plugin when the "Jobs" page is loaded. How am I able to do it? This is my code so far. <?php /** * Plugin Name: wp-retrieve-database * Description: retrieves data ...
4
votes
1answer
108 views

Hook when category is added to post

I'm trying to do something when a category is added to post and saved. I thought that using the save_post hook would have registered when a category is added to a post, but it doesn't appear to. When ...
1
vote
2answers
483 views

wp_mail - Remove sitename from email subject

Can some one tell me how to remove site name from email subject. As of now my email subject looks like this [sitename] - Subject goes here I want it to look like this Subject goes here I ...
3
votes
1answer
250 views

Hook into admin post list page

So I want to create a custom admin interface for the post and page lists. I want it to be a split view with a list of posts and some data on the left, and a full editable preview of the post on the ...
2
votes
1answer
133 views

What does (10, 2) mean when used with add_filter

Please tell my what is 10, 2 in below mention code: add_filter('nav_menu_css_class', 'add_active_class', 10, 2 ); function add_active_class($classes, $item) { if($item->menu_item_parent == 0 ...
0
votes
1answer
720 views

is_home() not working in functions.php file

I'm using woo themes and trying to use some woo hooks to hook into the index.php file from my child theme. I'm using the following code: function content_woo_main_before() { if (is_home() || ...