This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // ------------------------------------------------------------------------------------- | |
| // Replaced with: https://gist.github.com/RadGH/d08a7466b097dfb895ec6dede2e474f5 | |
| // | |
| // Gravity Forms still does not have an official method to get selected checkboxes lmao. | |
| // ------------------------------------------------------------------------------------- | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // sample usage | |
| $url = 'http://example.org/'; | |
| $url_args = array( 'id' => 47, 'name' => 'radley' ); | |
| $body_fields = array( 'nonce' => 12345 ); | |
| $headers = array( 'Authorization' => 'api 123456' ); // Mailchimp-style api key using basic authorization | |
| $result = rs_remote_request( $url, 'GET', $url_args, $body_fields, $headers ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'admin_menu', 'myplugin_register_settings_menu_page' ); | |
| add_action( 'admin_init', 'myplugin_register_settings_fields' ); | |
| function myplugin_register_settings_menu_page() { | |
| add_options_page( 'My plugin', 'My plugin', 'manage_options', 'myplugin-settings', 'myplugin_display_settings_menu' ); | |
| } | |
| function myplugin_register_settings_fields() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| This function will loop through all posts matching a filter, allowing you to make some edits to them with PHP. | |
| To begin just visit your site ending with /?FojVDY83 | |
| Important: To avoid re-processing the same post infinitely, you need to make sure the meta_query will not match the same post after it has been processed. This is done below by checking if the meta key "status" exists or not. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| HOW TO USE: | |
| 1. Modify the table and logging function if needed. You probably want to remove "groups" which for my case, represented | |
| which group your user account belonged to. We needed to be able to isolate search requests based on group. | |
| 2. After your search term has been performed, log the search using rad_log_search_term(). | |
| 3. Build some fancy dashboard to show the data, or be a nerd and do your own mysql queries every time. | |
| 4. IMPORTANT: The activation hook for "rad_activate_plugin" MUST go in your plugin main directory. If the plugin is active | |
| when you add this code, just call rad_activate_plugin() manually once, refresh a page, then remove the manual call. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Returns an array of terms used by the list of post IDs.= | |
| * By default returns an array of arrays, each with the keys: term_id, slug, name, term_taxonomy_id | |
| * You can get an array of single values by changing $return to one of: term_id, slug, name, term_taxonomy_id | |
| * | |
| * @param $post_ids | |
| * @param $taxonomy | |
| * @param string $return | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Adds an object to the given folder name. | |
| * | |
| * @param $object_id | |
| * @param $folder_name | |
| * @param $parent_folder_id | |
| * | |
| * @return bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| UNTESTED CODE BELOW | |
| Infusionsoft triggers a POST request that sets user roles. | |
| This function retrieves that request and processes the role change. | |
| Be sure to enter your $internal_access_key below. | |
| You may need to change the meta key "infusionsoft_contact_id". Consult your infusionsoft plugin documentation to find what that key is named (or search the wp_usermeta table in the database) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Add sub options page with a custom post id | |
| */ | |
| if( function_exists('acf_add_options_page') ) { | |
| acf_add_options_sub_page(array( | |
| 'page_title' => 'CSV Sync', | |
| 'menu_title' => 'CSV Sync', | |
| 'parent_slug' => 'users.php', |