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)

14
votes
3answers
2k views

How many times will this code run? (or, how rich is grandma?)

Hypothetical example but real world applicability (for someone learning, like me). Given this code: <?php function send_money_to_grandma() { internetofThings("send grandma","$1"); } ...
0
votes
2answers
54 views

How to change a field in database through a submit button or Checkbox? [closed]

I'm trying to create a plugin for wordpress where the form stores data in a database. I'm trying to make a submit button to update the status (field) of one row from 0 to 1 but its updating all the ...
1
vote
3answers
59 views

Trying to understand order and frequency of action hooks firing

I'm working on a plugin that modifies user capabilities and turns off a lot of things in the Admin pages. I'm having some problems with order of execution with my code, so I want to refactor it and ...
0
votes
3answers
36 views

Sending Parameter Failed

This is so basic, but i couldn't understand why it's not working, i'm trying to send parameter from add_action(), this is my code in my function.php: function testingID( $testParam) { ...
0
votes
1answer
19 views

widget: input the px value from user and use it as inline style in widget function

I am trying to dynamically add margin-bottom property to my widget. For example, I am inputting the value "50px" from my widget and want to use this value to adjust margin-bottom property for the ...
0
votes
1answer
49 views

Enqueue script not working

This is my code to enqueue scripts. The later one with title yourscript2 is working, but the first one with title upload is not working: add_action( 'wp_enqueue_scripts', 'add_my_script' ); function ...
0
votes
0answers
35 views

How to pass variables to attributes to variations, of a Woocomerce variable product?

I am developing a plugin to make a API available. In this effort i am trying to Adapt woocomerce functionality to my plugin. I have a function that it is supposed to create a variation and fill the ...
1
vote
1answer
36 views

Is license need for free wordpress plugin

I'm developing a new WordPress, So i'm a beginner. I'm referring a plugin to create a readme.txt file. I've seen that two lines. License: GPLv2 or later License URI: ...
0
votes
0answers
60 views

Plugin options page - form with two different submit buttons

In my plugin options page I have two buttons, netted way down looks like this - a single form, with two submit buttons. <form action="options.php" method="post"> <input id="submit_button" ...
1
vote
0answers
38 views

Converting acf repetears to a datatable on frontend [closed]

I'm working on this more then 2 weeks and its driving me crazy. I'm really hope to find some help here so thanks in advanced for your time. My problem: because I don't even know if my way is feasible ...
0
votes
1answer
24 views

How to allow only two (or more) users access to a plugin

I need to allow two specific users, not groups, to use a certain plugin that is listed in the admin menu area. I have this code which allows one user (user id = 2) to see the plugin : add_menu_page( ...
1
vote
1answer
32 views

Is it possible to sort metabox teaxtarea values?

Textarea is on an options page, is it possible to sort the values within that textarea by alpha? I looked in the Codex but do not see any mention of sorting these values.
0
votes
1answer
76 views

WP Cron as Fast as WordPress AJAX?

I have a question about performing a very long and resource intensive task within WordPress. Here is the scenario. I have a plugin that allows users to run a task that takes a very long time and ...
0
votes
0answers
17 views

How to limit each front-end user to view just his own uploaded files on Amazon S3?

In my Wordpress website Users can upload video files directly to a Amazon S3 bucket, all of them use the SAME bucket for their uploads. After the upload is done each user should be able to view/delete ...
0
votes
1answer
31 views

Create a select metabox that the user can pupolate?

I have been working on a plugin that uses text area metaboxes on an options page to populate drop downs in the CPT area. I was with the help of some others able to get the list to show in the select ...
0
votes
1answer
121 views

PHP calling function within a class

I'm writing my own php class and I have multiple functions within the class. Something like this: class JSON_API_Hello_Controller { public function test_cat(){ global $json_api; ...
-1
votes
3answers
53 views

isset($_POST['submit']) ignored on comment submission

I am developing a swear filter plugin for my blog. It is supposed to deny submissions containing any words in a text file called swears.txt. Here is the code I am using for the comment form on single ...
0
votes
1answer
91 views

How to use Amazon Elastic Transcoder from Wordpress using AWS SDK for PHP?

Use Case: The user uploads his video from the frontend of my website in any format he wants to Amazon S3. Now I want to covenrt that video file to MPEG-4 using Amazon Elastic Transcoder by applying ...
0
votes
1answer
33 views

How can i create a pages for anonymous users in custom plugin..?

I am very new to WP. My requirement is to create a small Booking System as a plugin. I have 5 different pages for entering details step by step and Users can book as anonymous. Admin only need a mail ...
0
votes
1answer
51 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
34 views

Woo-commerce: Adding additional page sections using a child theme

I'm hoping to modify Woo-commerce by adding a section to every product page. I have a child theme setup with a copy of the Woo-commerce template files in it. I want the new section to appear under the ...
0
votes
1answer
79 views

How do I make this Metabox show current DB value?

<p> <?php $options = get_option( 'city' ); $names = explode( PHP_EOL, $options ); ?> <label for="City" class="timeshare-row-title"><?php _e( ...
0
votes
2answers
31 views

WP: adding Javascript to specific woo commerce pages

I'm developing an eCommerce site using Woo-Commerce, i'm hoping to introduce some JavaScript to my sale pages only, in the name of a finance slider. What is the best way to go about including a ...
0
votes
0answers
31 views

metabox inside custom post

i'm trying this to add metaboxes inside custom post but never show the metabox Function Reference/add meta box « WordPress Codex Example: But never show this inside custom type post, Only inside ...
0
votes
1answer
29 views

Plugin creation, restricting access to specific roles

I'm creating my first, fairly simple WP plugin. I'm struggling to get my head around permissions and access. How can I restrict access of the plugin to Administrators only? Is there a simple way I ...
2
votes
1answer
146 views

What is rich_editing?

I wanted to learn more about shortcodes with button implementation since I do not use them much and I have been doing a lot of research on the topic and the questions and tutorials I run across use a ...
0
votes
1answer
17 views

Overwriting a plugin function

I need to write a function in my own plugin and overwrite a function from another plugin and (preferably) not make any changes to it. Or WordPress' core. So, basically, what I need to happen is: ...
0
votes
1answer
37 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
0answers
42 views

Error extending widget class defined in another plugin

I am trying to extend a widget class from another (widget) class in a 3rd party plugin - so hierarchy like this: 3rd_Party_Widget extends WP_Widget (in 3rd party plugin) My_Widget extends ...
0
votes
0answers
31 views

Wordpress Custom JQuery Trigger no working on plugin

Experienced web developer here but have never worked with Wordpress. I am having a problem with custom JQuery code. I am trying to trigger an event when a change of selection occurs on a select form ...
1
vote
1answer
103 views

Why is my shortcode not working

Im making a custom shortcode for my wordpress site and im just running through the example from the shortcode api for wordpress: function myshortcode() { $atts = shortcode_atts( array( ...
0
votes
0answers
13 views

Sending data to table

I am creating a plugin which asks users to enter their department, position and resume. I need to upload this data to a WordPress table. I am reading Codex but unable to understand how to send data to ...
0
votes
0answers
48 views

WP custom plugin: Handling form actions

I'm attempting to create a form which calls a php file on post action, when the action is called I get a page not found however. The form is shown below: <form action="uploader.php" method="post" ...
0
votes
1answer
17 views

Issues with a WP plugin menu system

I'm attempting to create a simple menu layout for a plugin. This is my first attempt at creating a plugin so apologies for what probably an obvious mistake here. This is the code I have to create the ...
0
votes
0answers
35 views

Export User Info into CSV - Additional Column (post_title)

I'm using the 'Export Users to CSV' a plugin for wordpress. By default, The plugin only extracts wp_users and wp_usermeta I have been wanting to add post_title column from wp_posts. I was able to ...
0
votes
1answer
54 views

Grandchildtheme (plugin) add header.php (not exist in child theme)

I'm writing a plugin and I need to replace some files of the used theme. For example I'd like to add the header.php file because this file is in grandparent theme and not in child theme. I replaced ...
0
votes
0answers
78 views

Problem with creating order in schedule event (woocommerce, wordpress)

I have created a schedule event in wordpress. The coce inside it is below (wordpress + woocommerce), $order = wc_create_order( $args = array() ); update_post_meta( $order->id, '_customer_user', ...
1
vote
2answers
129 views

action hook wp_head higher priority as all other plugins/hooks

I work a bit with the wordpress API and I want to try to include a <meta>-tag into my head area of my website. This is my code (works everything fine!): class dmd_noindex_options_page{ ...
0
votes
0answers
28 views

Plugin dev: How to multiply instances of a plugin in the same metabox?

I have a picture uploader that fits inside a metabox in the administration. I would like to have four instances of this uploader in the same metabox in order for the administrator to manage 4 ...
0
votes
2answers
41 views

Limit role to one plugin [duplicate]

Is there a way to do this without using another plugin and without modifying WP core code: I want to give the custom plugin I am writing a settings page. So I will need to add plugin capabilities to ...
0
votes
1answer
79 views

Change reset password URL returned by wp_lostpassword_url() via plugin

With a plugin how would you change the URL returned by wp_lostpassword_url()? The function wp_lostpassword_url() returns the URL where users can reset their password. Function Reference/wp ...
0
votes
2answers
35 views

Can I use namespaces in my plugin?

I am building a plugin that I hope to eventually put on Envato CodeCanyon. Currently I am creating functions of the form mypluginname_action. This is quickly becoming silly as I have to do that a ...
1
vote
1answer
76 views

Adding dynamic section to WordPress

[Edit: I've added a more concrete example below] I need to convert a custom PHP site to WordPress. The site has 60,000+ media items along with a ton of metadata, all of which needs to carry over to ...
0
votes
1answer
24 views

What do “and” means infront of a variable? [closed]

When we use & in argument in function it means if we change the variable inside that function the variable will be not be changed outside. <?php function add_10(&$number) { $number ...
0
votes
0answers
9 views

Add Flatr button to Sharing option

I know adding a Flatr button to the sharing option is possible on wordpress.com and I wondered if there is a way to do so on a self hosted wordpress ? If not, do I have to create my own plugin or is ...
3
votes
1answer
61 views

How does WordPress treat rewrite rules “under the hood”?

I am messing around with WordPress, trying to get a good grasp of the thinking behind conventions used in WordPress. I came across a question, and my searches fell short of explaining what I was ...
0
votes
1answer
55 views

get_users() not returning all users in site

I'm fairly new to wordpress/php development, so forgive me if this is a stupid question. I'm trying to get a list of all the users with metadata in order to export them to a CSV file. We currently ...
0
votes
1answer
126 views

How can I hook into existing WordPress Bulk actions?

I am creating a plugin which syncs both standard WP data and custom fields within a custom meta box on post edit pages, to an external resource using SQL queries. However my functions are currently ...
0
votes
0answers
39 views

add_order_item from custom endpoint

Im useing WP>Woocommerce->Woocommerce subscriptions I have created a custom endpoint: /edit-subscription/. You can see exactly what i did in the last comment here: ...
0
votes
2answers
31 views

How to write to a separate PHP file in plugin settings

I need a way of taking a variable from a plugin's settings and write it to a small key file located in the plugin's directory. The entire contents of the key file is this: <?php $transaction_key ...