Tag Info

Hot answers tagged

2

lets say we're registering 3 post types: is it worse for performance to do this in 3 different plugins (one for each post type), than registering all 3 in one plugin? in other words, is using an extra plugin adding to the load time, even if it doesn't do anything? The technical process of plugin load is a simple PHP include. So there is no significant ...


2

I got the following tutorial a very good start for a widget creation: How to Create a Custom WP Widget — WPBeginner And I used the tutorial and made my own first widget from my plugin. You can get all my code here in Github.


1

It's probably due to an unclosed curly brace somewhere. Can include more code? The line numbers in the error message are not always where the actual issue is.


1

Your path have an extra _ in between widget-plugin.php and /js/upload.js. BTW, your path should just be plugins_url( '/js/upload.js' , __FILE__ ), Go and check the following wp_enqueu_scripts wp_enqueue_script wp_register_script admin_enqueue_scripts


1

Finally figured it out. Using the plugin mentioned above (linked here for ease) and the basics of the answer to this question I was able to cobble together this code It's a bit hamfisted, I'll admit that (mainly replacing the preg_match with strstr) but it got the job done. I'm open to any improvements you all can think of so please feel free to comment ...


1

Without FTP access, if you have an administrative login to the WordPress admin you can grab the code from plugins and themes one file at at time. For themes go to Appearance > Editor For plugins go to Plugins > Editor Select the appropriate theme / plugin and go through the list of files downloading the code, css, etc. This will not have the images, but ...


1

If you can use the backend to install plugins, you can try to use the plugin backwpup: https://wordpress.org/plugins/backwpup/ it does a complete backup of your site in a folder or to a cloud-service like dropbox. Also, it provides an own compression unit so if pclzip is deactivated, you can still use tar ^^


1

One way could be to use classes and objects. It's more efficient considering reusability, collective work and more. I don't think it's bad to use global variables if you know what you're doing. So I would recommand you to use OOP (object oriented programming) especially with inheritance and polymorphism.


1

So, how to have the flexibility to pass variable into any Wordpress' action/filter and while maintain the flexibility to cancel them later? You could assign the function to one of the class's properties: public function __construct() { $foo = 'bar'; $this->init_func = function() use ( $foo ) { echo $foo; }; add_action( ...


1

Wordpress looks for the Plugin Header in the php files. The main Plugin file should have a header like this: <?php /** * Plugin Name: Name Of The Plugin * Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates * Description: A brief description of the Plugin. * Version: The Plugin's Version Number, e.g.: 1.0 * Author: Name Of The Plugin Author ...



Only top voted, non community-wiki answers of a minimum length are eligible