Articles of php

Making Quote Plugin more efficient

I’ve been working on this plugin the past couple of nights and have been jotting down idea’s of how to improve it. My knowledge of php isn’t the strongest and I’m learning as I go along most of the time. Questions: Is there more efficient ways to validate the quotes using the wordpress api? What […]

Anyone can register via backend

My question is simple. Is it possible to enable option “Anyone can register” with php function? Thanks.

Create Image Uploader for Widget

I found this post// Use Media upload in custom widget on wordpress 3.5 I’m not experienced in any of this so I pretty much just copied the code he provided into my own functions.php file. I uploaded the JS and everything… I then replaced certain code that “sven” posted in his answer. The uploader works […]

Use WordPress' URL rewrite engine

I’m developing a web application with user submissions, i’m not too hot on mod-rewrite and was hoping there is a way to utilise WordPress’ amazing rewrite engine and incorporate this somehow into my PHP/AJAX web application?

Calling a plugin in theme development

I am trying to call plugins on a theme page. Specifically I am after the ‘User Avatar’ theme but their will be other later. How do I call a plugin on a theme? Presumable something linke <?php …plugin name… ;?> but that isn’t it. Any ideas. Marvellous

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 wrapper start begins. I’ve already found this link which allows me to change the wording of the message but what I need is […]

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, whenever I visit the custom admin page of my plugin with that parameter in the URL (www.example.com/wp-admin/admin.php?page=mycustompage&pworkspage=2) my script can’t see the parameter […]

class=“parent” for wp_list_pages?

<div class=”menu”> <ul> <?php wp_list_pages(‘exclude=&title_li=’); ?> </ul> </div> creates the following output… <div class=”menu”> <ul> <li><a href=”#”>Page 1</a></li> <li><a href=”#”>Page with Subpages</a> <ul class=”children”> <li><a href=”#”>Page with another subpage</a> <ul class=”children”> <li><a href=”#”>subsubpage</a></li> </ul> </li> </ul> </li> <li><a href=”#”>Page 3</a></li> <li><a href=”#”>Page 4</a></li> </ul> </div> All pages with children have a ul class=”children” applied. Is […]

Can WordPress email the admin about PHP errors, while hiding them from the site?

Is it possible to have WordPress email the site administrator whenever a PHP error message is displayed? Ideally the message would also be filtered out of the HTML output, so as to avoid information disclosure. I ask because, while @ini_set(‘display_errors’, 0); is at the top of my wp-config.php and working nicely, I want to receive […]

Output custom post shortcode. Help spot the error.

so I have written the below shortcode that outputs a list of custom posts. When I echo out the values it works fine. But when I do it a slightly different way and join variables it does not. It doesn’t really matter but I would like to now why. This works fine. function post_events($atts) { […]