WordPress Plugins allow easy modification, customization, and enhancement to a WordPress blog. Instead of changing the core programming of WordPress, you can add functionality with WordPress Plugins.

learn more… | top users | synonyms (1)

0
votes
1answer
27 views

Getting duplicate page when activating my plugin

I am creating a plugin in which I need to create a dynamic page and assign a template to it. I have created it using the code below: function gallerypage() { global $wpdb; $check_page = ...
0
votes
1answer
69 views

How to call external functions from a PHP script in a WordPress plugin?

I'm a WordPress beginner, and I have tried to develop plugins, but I don't know how to call external functions in a WordPress plugin. For example, I have an external PHP script called download.php in ...
0
votes
0answers
21 views

Displaying friend's posts only

So I am using the WPMU Dev friends plugin which adds functionality for WP members to search for friends and to add new friends etc. There is a specific function defined in the PHP file which says it ...
1
vote
1answer
21 views

preprocess_comment array doesn't have comment_ID

I have a function using the filter preprocess_comment and want to use the update_comment_meta( $comment['comment_ID'], 'post_id', $post_id );. However, the array in preprocess_comment doesn't have ...
0
votes
1answer
20 views

Proper Prepare Statement for ALTER TABLE and using AFTER

My code for ALTER TABLE doesn't make use of the prepare() method of $wpdb and so the code needs to be updated properly. There are plenty of examples of query SELECT, etc but couldn't find something ...
0
votes
0answers
24 views

Adding tab to custom TinyMCE plugin

I am creating a custom button for the wp posts editor by following this documentation. I replaced the addCommand callback with something like this: ed.windowManager.open({ ...
0
votes
1answer
13 views

Plugin outputs content of posts unbidden!

I've written my first plugin. The intent is to show the image, title and excerpt of the first 6 posts. (It uses a function from Divi, here and there). function jm_blog_layout($atts) { ...
0
votes
1answer
50 views

Taxonomies within plugin invalid

I have two taxonomies being registered in a functions file. They are then initialized like so: function foo_register_post_types_and_taxonomies() { foo_register_post_types(); // defined in ...
3
votes
1answer
80 views

How to call “page specific menu items” in template

I have installed a plugin for giving custom command for menu to display on each Page Specific Menu Items, now I need to display these menus on theme header. Can I use anything like wp_nav_menu(). ...
0
votes
1answer
40 views

Backslashes being stripped from CSS

The title explains my problem. Upon saving CSS stylesheet in the "Appearance > Editor", single backslashes are being stripped out of the stylesheet. For example: content="\foo" becomes: ...
0
votes
1answer
2k views

How to access global variable $menu inside a class function

am puzzling why can't i access the global variable $menu inside a php class function class adminMenus { public function getWPdefaultmenus(){ global $menu; return $menu; } } using ...
0
votes
0answers
15 views

How to display .ptm file in my WP site without JAVA

I created a wordpress site which displays Polynomial Texture Map (.ptm) using Java PTM viewer developed by Hembo Pagi. See here. It uses WP shortcodes, so to embed my file by just write: [rti ...
10
votes
4answers
3k views

Update widget form after drag-and-drop (WP save bug)

I've posted a bug-report about this a few months ago (on WordPress trac (Widget Instance Form Update Bug)) and I thought I'd try writing about it here too. Maybe someone has a better solution to this ...
4
votes
1answer
36 views

How can I allow for multiple template views on the Gallery Settings page when using the Visual Editor?

I'm trying to extend this answer by making it possible to switch shortcode attributes from the UI and alter the gallery markup based on those attributes. [gallery owl="true" link="none" ...
1
vote
1answer
21 views

Enqueueing stylesheets on particular plugin admin pages using WordPress Plugin Boilerplate

I'm writing a plugin using WPPB, and can't seem to get my CSS to enqueue just on my plugin's admin page. I've got a function in my class-{plugin}-admin.php file that should enqueue the script. And I ...
1
vote
1answer
39 views

A custom post type in another post type

I can't seem to find an answer to the following question. English is not my native language so its sometimes hard to find the right words. I know how to build custom post types but i want to go a ...
0
votes
1answer
5 views

Wordpress upload path decalration

I am trying to use wp-filesystem to write css data.I have things working perfect here. $filepath = get_template_directory() . '/dynamic/'; $wp_filesystem->mkdir($filepath); But ...
1
vote
1answer
20 views

How to customize a permalink (URL) structure?

i am using $post->guid to get the URL of an attached file to my post. the output is something like this: http://example.com/foo/ [where foo is the file name]. now i want to make a URL like ...
0
votes
1answer
30 views

Should all roles be allowed CRUD operation on the database?

Is there any limitation that any specific role out of (Admin/Subscriber/Editor/Contributor etc) can perform CRUD operations on database. In my WordPress website, all users are subscribers and they are ...
3
votes
1answer
5k views

Where is the best place to use add_filter

Should I use the function add_filter In my plugin's init action hook or just the in the main plugin script? Since sometimes I found people is using filter all over the place and if I put in the init ...
2
votes
1answer
2k views

Explanation of the “posts_join” and “posts_fields” filter hooks?

I'm new to the "posts_" filter hooks and wanted to know a few things from those in the know: In this question, someone posted an answer using posts_join that took a second parameter of $query: ...
1
vote
1answer
33 views

Strange Situation When Try To Retrieve Github Gist Using wp_remote_get

I have fall in a strange situation. Take a look at below code: <?php $args = array( 'headers' => array( 'Accept' => 'application/vnd.github.v3+json', 'Authorization' ...
-1
votes
2answers
55 views

How can I add a custom meta value on file upload?

I am looking for an option where a custom meta value will be saved when user uploads an attachment. Lets say I need a meta key _example_meta_key and want to save meta value of this as ex087659bh (It ...
2
votes
2answers
42 views

How often do you need to register_post_type?

Assuming you write a plugin and hook into activation / deactivation to register_post_type is that good enough? Or do you need to do it every init? I'm looking for perf boosts and I want to reduce ...
4
votes
1answer
143 views

Turn Shortcode Gallery into Carousel in WordPress 4.4

I searched for existing plugins that could do carousels in wordpress posts but they turned out to not display correctly in WordPress 4.4 which released recently. ...
0
votes
1answer
29 views

INCOMING: Wall of code for form and $_POST, not updating custom field's value

its been a long two days in an attempt program a plugin from scratch to provide a front end landing page with 2 forms. Depending on which form the user wants to use, the form shall change a value in ...
0
votes
1answer
41 views

How to replace default comments with custom HTML?

I'm going to replace default list of comments and comment form with Facebook's comment box. As far as I know there is function wp_list_comments(). How can I replace this function with my custom one? ...
0
votes
0answers
35 views

Custom Message with Order status from WooCommerce Payment Gateway Callback to Order Thank You Page

I would like to pass on the custom message to order-received page in woocommerce. Here how i currently handle the callback from payment gateway if ( isset( $_REQUEST[ 'callback' ] ) { ...
2
votes
3answers
78 views

Remove profile picture option (and other things) from profile.php (in admin)

Just upgraded to WordPress 4.4 and I notice now my users' profile page in admin, there's a section called "profile picture", with a link to Gravatar. The plugin I'm developing restricts a lot of ...
2
votes
1answer
83 views

Add CSS animation as Preloader to WordPress

I found a CSS animation snippet on Codepen, and would like to add it in my WordPress site for preloader animation, but I couldn't find any related help or plugin that would allow me to add a Preloader ...
0
votes
1answer
38 views

Javascript in plugin not working

I'm working on a plugin that relies on several JS scripts. In my plugin file (graph-plugin.php) I've the following function: function initialize_scripts() { wp_register_script( 'int-flot', ...
0
votes
0answers
20 views

Simple renaming my custom post type set with a plugin doesn't work?

I have created a plugin which activates a custom post type and it all works, but now i wanted to rename the custom post type, say "future-visitors" in stead of "past-visitors". But when i just ...
0
votes
0answers
16 views

Add custom post name only with page URL

The problem I have is that the "travel destinations" are pages and the "accommodations" for each destination are custom posts, therefore the permalinks break. My destinations here: ...
0
votes
1answer
22 views

Associating special meaning with user id 0

I'm writing a plugin that creates a custom table holding data which is linked to a user account with a user_id field. Now if that users account would be deleted for any reason I would like to set that ...
0
votes
1answer
18 views

How to use a WP_Customize_Control outside of the Customizer?

I have a few custom WP_Customize_Control classes that are shown within the standard WordPress Customizer area. These are working fine. Is it possible to pull some of these out of the customizer and ...
1
vote
0answers
700 views

Plugin generated virtual pages

I am currently devloping my first WP plugin. This plugin should generate dynamic pages on the fly if a fixed non-existing URL is requested. This means I want my installation to accept addresses like ...
1
vote
1answer
5k views

Email verification for new users

I would like to implement a plugin that requires new users to reply to an email, to verify their email address, on registration. I am already doing extensive codex research, but I am very new and ...
0
votes
1answer
12 views

Why is the form not updating when I select a new sector from the list?

Im trying to fix a form on http://s195004125.websitehome.co.uk/jobs/ for some reason the sector selection box doesnt update the list below when a change ios made but it changes when you select a ...
0
votes
2answers
344 views

Second select list values are not saved after clicking update

I have a select list in a metabox which value is saved successfully after clicking "Update" when editing post. Of course, the values are custom taxonomies. But i don't know how to add another select ...
0
votes
0answers
18 views

Creating the Custom post type inside plugin page?

Is it possible to create the custom post type inside the plugin page same as it appears individually with all of its filters and action button on the plugin page?
4
votes
2answers
51 views

Turn revisions off in plugin instead of config.php?

Is there a function to set WP_POST_REVISIONS from a plugin instead of having to do it in config.php? I was thinking of doing this: runkit_constant_redefine( 'WP_POST_REVISIONS', 0 ); but that puts ...
-1
votes
1answer
42 views

What is the source outline for a basic word press plugin?

I'm a fairly skilled PHP developer, and watching a tutorial on how to build a WP plugin, with the intention to get my name out there. What is the outline for a WP plugin that includes database calls? ...
0
votes
0answers
8 views

Multiple page plugin settings

I am building a plugin and I have made a single setting page that is working without any issue. Since it is becoming very long, and that it is made of 3 distinct sections, I wanted to split it in 3 ...
0
votes
1answer
43 views

Need to change buddypress profile url by add_rewrite_rule

I have some problem with wordpress/ buddypress url rewrite So i have a url like localhost/site/members/admin/jobs/it-job-create/ but need to make it localhost/site/members/admin/jobs/it-job/create/ ...
0
votes
1answer
41 views

Adding a brand column to WooCommerce Products

I'm going to attempt to add a brand column to the WooCommerce Products admin table, and also update the search filter so it searches for brands also. Has anybody done this before though? I've never ...
0
votes
0answers
20 views

How can I use get id with wp job manger category search?

Im trying to make a form that goes from the home page where you can fill out location and job sector from a drop down list and then its sends the values to the jobs page and search the jobs with the ...
1
vote
4answers
11k views

How to add multiple images to custom post type?

I would like to create a simple plugin to add multiple images to a custom post type. I have created a plugin to add a single image to a custom post type, but I am unable to figure out how to add ...
0
votes
0answers
20 views

Showing category not added after adding category

I am submitting "add category form" by triggering submit event on form with jQuery. It adds category but still show "Category not added error". $("#submit").on("click", function(){ ...
0
votes
1answer
16 views

Filter get_user_by instead of replace function

I have developed a plugin (despite minor understanding) that replaces pluggable function get_user_by to pull userdata from another source. While this works, it can lead to maintenance whenever there ...
0
votes
1answer
43 views

Action Links in Class located in Subdirectory of Plugin

A class for action links in a plugin loads properly if the class is placed inside the main plugin.php file. If the class is moved to a separate file located in a subdirectory of the plugin then the ...