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 /* | |
| Plugin Name: WP Plugin Autoloader | |
| Plugin URI: http://www.caavadesign.com | |
| Description: Proposed usage of a WP autoloader | |
| Version: 0.0.1 | |
| Author: Brandon Lavigne | |
| */ | |
| # Plugin Autoloader |
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
| # Plugin Autoloader | |
| do_action('plugin_autoloader'); | |
| # Plugin B | |
| add_action( 'plugin_autoloader', 'loadStuff' ); | |
| function loadStuff(){ | |
| require_once 'class.dostuff.php'; |
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
| array (size=613) | |
| 'pre_term_name' => | |
| array (size=2) | |
| 10 => | |
| array (size=2) | |
| 'sanitize_text_field' => | |
| array (size=2) | |
| ... | |
| 'wp_filter_kses' => | |
| array (size=2) |
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
| array (size=487) | |
| 'pre_term_name' => | |
| array (size=2) | |
| 10 => | |
| array (size=2) | |
| 'sanitize_text_field' => | |
| array (size=2) | |
| ... | |
| 'wp_filter_kses' => | |
| array (size=2) |
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
| add_action('init', 'remove_jetpack_widget_conditions',11); | |
| function remove_jetpack_widget_conditions(){ | |
| global $wp_filter; | |
| remove_action( 'init', array('Jetpack_Widget_Conditions','init'), 10 ); | |
| //add_action( 'init', 'caava_widget_conditions', 12 ); | |
| var_dump($wp_filter); | |
| } |
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 /** | |
| * Plugin Name: Jetpack widget visibility query args | |
| * Plugin URI: http://caavadesign.com | |
| * Description: Add the ability to add query args to jetpacks visibility widget | |
| * Version: 1.0.0 | |
| * Author: Brandon lavigne | |
| * Author URI: http://caavadesign.com | |
| * License: A short license name. Example: GPL2 | |
| */ |
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
| function tt_widget_visibility_js() { ?> | |
| <script> | |
| jQuery(function($) { | |
| $( document ).on( 'change.widgetconditions', 'select.conditions-rule-major', function() { | |
| var $conditionsRuleMajor = $ ( this ); | |
| var $conditionsRuleMinor = $conditionsRuleMajor.siblings( 'select.conditions-rule-minor:first' ); | |
| var $conditionsRuleQueryVars = $conditionsRuleMajor.siblings( 'input.conditions-rule-query-var' ); | |
| console.log($conditionsRuleMajor.val()); | |
| console.log($conditionsRuleMinor); |
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
| # install Xcode from app store, then run: | |
| open https://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 | |
| # agree to apple license agreement | |
| sudo xcodebuild | |
| # agree to developer tools license | |
| sudo gcc |
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
| function wp_nav_menu_items_filter($items, $args){ | |
| global $sitepress_settings, $sitepress; | |
| $current_language = $sitepress->get_current_language(); | |
| $default_language = $sitepress->get_default_language(); | |
| // menu can be passed as integer or object | |
| if(isset($args->menu->term_id)) $args->menu = $args->menu->term_id; | |
| $abs_menu_id = icl_object_id($args->menu, 'nav_menu', false, $default_language ); |