Plugin Directory

Changeset 1489016


Ignore:
Timestamp:
09/02/2016 05:19:05 PM (10 years ago)
Author:
thrivehive
Message:

Adding endpoints for setting website phone number

Location:
thrivehive/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • thrivehive/trunk/controllers/menus.php

    r1438031 r1489016  
    15281528    }
    15291529
     1530    public function get_website_phone(){
     1531        global $json_api;
     1532
     1533        $nonce_id = $json_api->get_nonce_id('menus', 'get_website_phone');
     1534        $nonce = wp_create_nonce($nonce_id);
     1535
     1536        if(!wp_verify_nonce($nonce, $nonce_id)){
     1537            $json_api->error("Your  `nonce` value was incorrect");
     1538        }
     1539
     1540        $phone_number = get_option("th_phone_number");
     1541        return array('option' => $phone_number);
     1542    }
     1543    public function set_website_phone(){
     1544        global $json_api;
     1545
     1546        $nonce_id = $json_api->get_nonce_id('menus', 'set_website_phone');
     1547        $nonce = wp_create_nonce($nonce_id);
     1548
     1549        if(!wp_verify_nonce($nonce, $nonce_id)){
     1550            $json_api->error("Your  `nonce` value was incorrect");
     1551        }
     1552        if(!isset($_REQUEST['phone_number'])){
     1553            $json_api->error("You must provide a `phone_number` to set for the option");
     1554        }
     1555
     1556        update_option("th_phone_number", $_REQUEST["phone_number"]);
     1557        return array();
     1558    }
     1559
    15301560}
  • thrivehive/trunk/readme.txt

    r1477861 r1489016  
    3535
    3636== Changelog ==
     37* V 1.124 Adding setting of website phone number via the API
    3738* V 1.123 Adding support for non-hardcoded forms where applicable
    3839* V 1.122 Fixing issues with static maps API
  • thrivehive/trunk/thrivehive.php

    r1477861 r1489016  
    55   *Plugin URI: http://thrivehive.com
    66   *Description: A plugin to include ThriveHive's tracking code
    7    *Version: 1.123
     7   *Version: 1.124
    88   *Author: ThriveHive
    99   *Author URI: http://thrivehive.com
Note: See TracChangeset for help on using the changeset viewer.