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 | |
'location' => array( | |
array( | |
array( | |
'param' => 'widget', | |
'op' => '==', | |
'value' => 'pages' | |
), | |
array( | |
'param' => 'widget', |
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
$installed_plugins = array(); | |
// check if ACF is installed | |
if ( is_multisite() ) : | |
$network_plugins = get_site_option( 'active_sitewide_plugins', array() ); | |
$site_plugins = get_option( 'active_plugins', array() ); | |
$installed_plugins = array_merge($network_plugins, $site_plugins); | |
else : |
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
// All of your classes in /acf/forms/ are called anonymously | |
// so it's near impossible to filter them out without this jargon. :( | |
// example of won't work, but should | |
remove_filter('in_widget_form', array('acf_form_widget', 'edit_widget'), 10 ); | |
// See http://wordpress.stackexchange.com/questions/137688/remove-actions-filters-added-via-anonymous-functions | |
function acfw_remove_object_filter( $tag, $class, $method = NULL, $priority = NULL ) { | |
$filters = $GLOBALS['wp_filter'][ $tag ]; | |
if ( empty ( $filters ) ) { |
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
// Line 109 from EDD_SL_Changelog_Widget.php | |
$changelog = apply_filters( 'edd_sl_changeloge_widget_output' , get_post_meta( $post_id, '_edd_sl_changelog', true ) ); |
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
$edd_updater = new EDD_SL_Plugin_Updater( ACFW_STORE_URL, __FILE__, array( | |
'version' => ACFW_VERSION, // current version number | |
'license' => $license_key, // license key (used get_option above to retrieve from DB) | |
'item_name' => ACFW_ITEM_NAME, // name of this plugin | |
'author' => 'Daron Spence', // author of this plugin | |
'url' => home_url() | |
) | |
); |
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
// Insert before headers are sent (line 582) in EDD_Software_Licensing.php | |
do_action( 'edd_sl_remote_license_check', $result, $item_name, $item_id, $url, $expires, $license_id ); |
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_filter( 'acfw_include_widgets', 'add_include_widgets' ); | |
function add_include_widgets(){ | |
$acfw_widgets = array( | |
array( | |
'title' => 'Test Widget 1', | |
'description' => 'A widget test from functions.php', | |
'slug' => 'test-widget', | |
'id' => 'Test_Widget', |
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_filter( 'acfw_dir', 'acfw_directory' ); | |
function acfw_directory( $dir ){ | |
// default value is /acf-widgets/ | |
return '/acfw/'; | |
} |
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', function(){ | |
global $wp_roles; | |
$roles = $wp_roles->roles; | |
$choices = array(); | |
foreach ( $roles as $key => $value ){ | |
if ( $key !== 'administrator') | |
continue; |
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('wp_head', function(){ | |
global $posts; | |
foreach ( $posts as $post ){ | |
if ( strpos($post->post_content,'[acfe_form') !== false ){ | |
echo 'Contains the shortcode<br>'; // now do acf_form_head() | |
} | |
} | |
}); |