wordpress-plugin

Json returns every character as a separate object?

≡放荡痞女 提交于 2019-12-21 12:58:42
问题 I have a json object that I'm loading from wordpress using the JSON API plugin. When I load the json object and try to log out the parts of it, it seems like it treats every single character as its own object so the loop returns me a couple thousand objects all with item in it which is a single character. This is my first time using json so idk if i'm missing a step here. this is the code I'm using so far. function getProjInfo(theId){ $.ajax({// calling the ajax object of jquery type: "GET",/

Two wordpress sites using diiferent themes on the same database

做~自己de王妃 提交于 2019-12-21 04:43:10
问题 I want to run 2 wordpress sites, one.site.com and two.site.com from the same database. Everything remains the same except for the theme. one.site.com - Existing site two.site.com - Should use one.site.com's database except for the theme Is there any way this can be done ? Since theme details are stored in wp_options table is it possible for two.site.com to use it to display a different theme ? Say duplicating that table and making two.site.com use it ? I appreciate any help. EDIT: Both the

Wordpress custom widget image upload

你离开我真会死。 提交于 2019-12-20 08:55:20
问题 I'm busy with building my own Wordpress Widget. Everything works fine except for the Wordpress media up loader. I have created eight buttons and eight input text fields which should contain the url of the image that has been uploaded. The click event is not being fired, probably because Wordpress outputs the HTML twice(Once in the bar of the available widgets and once in the bar currently active widgets). Does anybody sees what I'm doing wrong? Below you find my code. Thanks in advance for

Wordpress custom widget image upload

我怕爱的太早我们不能终老 提交于 2019-12-20 08:54:15
问题 I'm busy with building my own Wordpress Widget. Everything works fine except for the Wordpress media up loader. I have created eight buttons and eight input text fields which should contain the url of the image that has been uploaded. The click event is not being fired, probably because Wordpress outputs the HTML twice(Once in the bar of the available widgets and once in the bar currently active widgets). Does anybody sees what I'm doing wrong? Below you find my code. Thanks in advance for

Wordpress get plugin directory

不打扰是莪最后的温柔 提交于 2019-12-20 08:47:16
问题 Is there any function that would return the full path of my plugin in WordPress? Example is path/wp-contents/plugins/myplugin I have tried plugin_dir_path(__FILE__) but returns the current dir. 回答1: Yeah as per description of plugin_dir_path it will give you current plugin file path. But as per what you asking here you can do something like below unfortunately no direct way, $plugin_dir = ABSPATH . 'wp-content/plugins/plugin-folder/'; 回答2: I would suggest to use a WordPress internal constant

Get post ID of current logged in user and add a link to the menu

天涯浪子 提交于 2019-12-20 07:14:26
问题 I am using a plugin called wp job manager, which creates "jobs" as wordpress posts. I am limiting the number of jobs a user can have to one and would like to add a direct link to their job in the navigation menu. I would also like to add a edit link, which is dynamically generated using the post id of the job. Seeing as though users will only have one post , I believe this is do-able. Edit: If I can even just get a link to the single post of the current logged in user and add it to the menu,

Insert into wordpress database - Call to a member function insert()

 ̄綄美尐妖づ 提交于 2019-12-20 06:00:18
问题 Im having an issue with inserting data into the wordpress database through my plugin. My plugin uses a shortcode to display a form from which some calculations are made and then that information is the then supposed to be inserted into the database but I end up getting this message. I can't seem to get it to work?.. Any help would be appreciated greatly. PLUGIN CODE used for the insert: include_once($_SERVER['DOCUMENT_ROOT'].'/wp-config.php' ); $wpdb->insert( 'wp_wine_bookings', array( 'name'

Count Checkboxes with Gravity Forms

三世轮回 提交于 2019-12-20 05:38:51
问题 I'm making a form that is for a summer camp registration form where users will be registering. By the end of the form there is an option of paying in full or making a $50 deposit for each camp selected. I'm using hidden products to handle the total amount per week and adding their value into the total. My question comes if I can use formulas to count the number of checkboxes that have been selected and do the calculations. Example: Week 1: Soccer camp Week 2: Computer camp Total: $100

WooCommerce Product Bundles - Cart Quantity

时光总嘲笑我的痴心妄想 提交于 2019-12-20 04:28:11
问题 Configuration: WordPress 4.1 The Events Calendar PRO 3.9 The Events Calendar: WooCommerce Tickets 3.9 WooCommerce 2.2.11 WooCommerce Product Bundles 4.6.2 For an Events website, selling the following tickets: Adult $25 Child $5 Infant $0 Family $55 (Consists of up 1-2 x Adult, 1-3 Child) The Family ticket is configured as a WooCommerce Bundled Product, with the bundled products being Adult and Child. Adult is set to a quantity of 2 and Child is set to a quantity of 3 When the Family bundled

How to create a search form for custom fields in Wordpress?

▼魔方 西西 提交于 2019-12-20 04:23:40
问题 Here's the code for my search form: <form role="form"> <div class="form-group"> <select class="form-control custform"> <option>Make (Any)</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> </div> <div class="form-group"> <select class="form-control custform"> <option>Model (Any)</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> </div> <div class="form-group"> <select class="form-control custform"> <option