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
31 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
109 views

plugin_dir_url & plugin_basename not working when plugin dir is outside wordpress dir

I have been using these functions for quite a while now but yesterday I noticed that they were not working properly on a site where the plugin directory was outside the main WordPress folder. ...
0
votes
0answers
30 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
3answers
140 views

How to determine if the current file is loaded in a plugin or in a theme?

How to determine if the current file is loaded in a plugin or in a theme? A boolean PHP function.
1
vote
1answer
42 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
14 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
0answers
40 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
63 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 ...
0
votes
0answers
20 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 ...
4
votes
1answer
79 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
26 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 ...
0
votes
1answer
7 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
21 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
40 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 ...
1
vote
1answer
42 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
68 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
45 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 ...
0
votes
1answer
139 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 ...
4
votes
1answer
349 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
44 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
166 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' ] ) { ...
0
votes
1answer
37 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 ...
2
votes
1answer
205 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
0answers
22 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 ...
2
votes
3answers
258 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 ...
0
votes
0answers
20 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
28 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
21 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 ...
0
votes
1answer
20 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
1answer
47 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
25 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
53 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
43 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
11 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
93 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
24 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
29 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
13 views

Theme editor removes backslashes

I'm having issues with backslashes being when saving changes to files in the Wordpress theme editor (theme-editor.php). So for example, Appearance > Editor > style.css I'm fairly certain that ...
0
votes
0answers
17 views

Submitting data to options.php from category admin page

I have created a new image field in Category taxonomy page which selects image using WordPress media up loader. Now I want to save the path of image and category name in wp_options table. I have ...
0
votes
0answers
48 views

Rewrite Rules: Post ID within Post Slug for a Custom Post Type

I've got my custom post type slug article and I need the following permalink structure: http://domain.com/article/postname-123/ The number in the end has to be the post ID. I don't want ...
0
votes
0answers
17 views

WordPress plugin admin html being shown in Customizer iframe

I have a WordPress plugin that is focused soley on the admin side of things. I have a peice of HTML that is shown on all admin pages using the all_admin_notices hook. This worked very well but I ...
1
vote
1answer
156 views

How to change post status from publish to draft using hook in wordpress?

I want to change the status of already publish post to draft using its id. add_action( 'save_post', 'change_post_status', 1 ); function change_post_status( $post_id ){ $my_post = array( ...
0
votes
1answer
40 views

Can the wp_posts table have the same slug (post_name) in multiple statuses (post_status)?

I'm using function get_posts to retrieve a set of post objects that are my custom post type (CPT). I am counting on being able to programmatically flip these posts between status "publish", "pending" ...
0
votes
0answers
31 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 ...
3
votes
1answer
20 views

Custom theme sufficient or custom plugin neccessary for this feature set?

I plan some sort of an event website. There are organisations, which can host zero, one or multiple events. Events are never published on their own. Events will be published as 'inline' snippets only, ...
2
votes
1answer
231 views

Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]

What I eventually want to do is when user logged-in to the site, I want to redirect the to the page with all the post created by that user and I want to load them via AJAX request. I have save ...
0
votes
0answers
23 views

Remove spaces if entered in “site name” on Multisite reg form

I used this with the Paid Membership Pro plugin on Multisite. https://github.com/strangerstudios/pmpro-network Its a few years old but tried and it works with one slight issue. When someone enters ...
0
votes
1answer
137 views

I can't fetch query parameters ($_GET parameters) with get_query_var

I am developing pagination for a list of posts in my plugin. I've added a custom parameter in my plugin_functions.php file: add_query_arg('pworkspage', 1); As you can see it defaults to "1". Now, ...
0
votes
1answer
27 views

WordPress Plugin Development- When our plugin functions call?

Assume that I have created plugin to include custom post type called site and plugin to search result. Assume I have added only following code to my plugin. function searchAll( $query ) { if ( ...
0
votes
0answers
55 views

Setting API - Default values for options when active the plugin

I have registered two options called test33_header_logo and test33_advertising_code. I need to set default options(test33_header_logo="logo1",test33_advertising_code=123456" when activate the ...