wordpress-plugin

PHP and WordPress: Debugging

一曲冷凌霜 提交于 2019-11-27 15:18:35
问题 I am writing some plugins and themes for WordPress, and I finding it hard to debug because somehow by the time the page has loaded, $_GET, $_POST and $_REQUEST are all empty. Even with error reporting set on, I am not getting error messages either other than a blank page whenever there is a fatal error. Is there anyway to enable a 'debug mode' for WordPress? Thanks! 回答1: Pear Debug Wordpress plugin: http://wordpress.org/extend/plugins/wp-pear-debug/ Update 4/08/2015: The above plugin hasn't

How to use session in wordpress in plugin development

走远了吗. 提交于 2019-11-27 13:50:35
问题 I am new to write a plugin ..I am having a testplugin.php file and a ajax.php file .. My code in testplugin.php is global $session; print_r($abc); //$abc is array of my data .. $session['arrayImg']=$abc; //saving data in session echo $session['arrayImg']; //displayin "Array" And my ajax.php consists of following code global $session; $abc = $session['arrayImg']; print_r ("abs== ".$abc); //displayin "abs== Array" And if use session_start(); I get following error Warning: session_start()

Enable CORS on JSON API Wordpress

≯℡__Kan透↙ 提交于 2019-11-27 13:38:54
I have this wordpress site with a plugin called JSON API. This plugin provides a JSON format for the content that is in the wordpress. I was able to enable CORS on the wordpress by adding header("Access-Control-Allow-Origin: *"); on the php header. But when I tried the url that the JSON API plugin provides the CORS does not work anymore. This is the wordpress site were I'm doing the tests... I used the test cors website to check if it was working and it is... http://kiwa-app.loading.net/ But when I try with the url that the JSON api provides me, is not working anymore. I'm still have the error

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\wordpress\wp-includes\class-http.php on line 1610

寵の児 提交于 2019-11-27 12:11:19
问题 I am facing that error while installing Jet pack plugin on my WordPress localhost site. i have search on this site many answer but that not fulfill my requirement 回答1: Please locate the file [XAMPP Installation Directory]\php\php.ini (e.g. C:\xampp\php\php.ini ) open php.ini in Notepad or any Text editor locate the line containing max_execution_time and increase the value from 30 to some larger number (e.g. set: max_execution_time = 90 ) then restart Apache web server from the XAMPP control

How does plugin system work (wordpress, mybb …)?

不想你离开。 提交于 2019-11-27 11:43:42
I'm curious how plugins work, I just know that instead of changing the code we use plugins, but how do they do their job without changing the code ? and what should a coder consider when coding a new project so it can have plugins ? and thank you very much :D There are multiple variations on how to implement a plugin system. Wordpress uses a quite common scheme often described as "hooks." I don't know the exact implementation but it basically works like this: // plugin.php script registers its own callback function register_plugin("hook_type", "plugin_function_123"); function plugin_function

Woocommerce get variation product price

南楼画角 提交于 2019-11-27 10:35:22
问题 Im trying to display the product variation price inside the variations dropdown. Im trying to change default behavior where price is displayed inside a div when you choose a variation on the dropdown. The problem is i cant find where that div is getting the variation price. I searched all javascript but couldnt find it If i use : add_filter('woocommerce_variation_option_name' ,'add_price_to_dropdown'); function add_price_to_dropdown($name){ global $product; return $name.' '.$product->get

Fatal error: Call to a member function get_price_html() on a non-object

自古美人都是妖i 提交于 2019-11-27 08:23:22
问题 I am trying to display the price of each product in the search it works for most products but when I search for a piticular product I keep getting this error Fatal error: Call to a member function getpricehtml() on a non-object in /home/public_html/wp-content/theme/search.php on line 76 this is the only search I get the error on "CUP0501-001 2822505 Jacobsen Reel Motor WMSM4". Here is the line on the search page that is giving me trouble getpricehtml(); ?> Any help would be appreciated. 回答1:

WooCommerce show custom column

不羁岁月 提交于 2019-11-27 07:29:40
I want to show a additional column in the backend of WooCommerce (in Orders overview). The column should contain a custom field, which i have defined (delivery date). How to do this? post_ahead In case someone still needs it - instructions on how to add new columns in Woocommerce orders list. No need in unsetting the default columns, just add this in your functions.php and your code will be valid for updates. 1. Define columns position and names add_filter( 'manage_edit-shop_order_columns', 'MY_COLUMNS_FUNCTION' ); function MY_COLUMNS_FUNCTION($columns){ $new_columns = (is_array($columns)) ?

Use JQuery Datepicker on dynamically created fields

让人想犯罪 __ 提交于 2019-11-27 06:58:45
问题 I have to use datepicker in wordpress site, in which a plugin creates fields dynamically with same name(array), same #id and same .class i try to use it using focus but i got error on it TypeError: inst is undefined Please hel <html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="assests/jquery-ui.min.css" rel="stylesheet"> <script src="assests/jquery.js"></script> <script src="assests/jquery

How to add the media uploader in wordpress plugin [duplicate]

我的梦境 提交于 2019-11-27 05:10:46
问题 This question already has an answer here: How can I use Multi Media Uploader in the WordPress Plugins? 5 answers I read out some of the tutorial for how to integrate the media uploader in wordpress plugins. I do the media uploader based on the tutorial. http://wordpress.org/support/topic/howto-integrate-the-media-library-into-a-plugin?replies=4 I do this and it perfectly working. When i tried the same script again for multiple times of media uploader, Here is the fiddle i tried simply changed