This file contains 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 | |
/** | |
* Collect custom scopes with Facebook Login WordPress plugin | |
* https://timersys.com/plugins/facebook-login-pro/ | |
**/ | |
// Change default scopes | |
add_filter('fbl/app_scopes', function( $scopes ) { | |
return 'email,public_profile,user_posts'; // pass custom scopes | |
}); |
This file contains 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
// To open popup with ID 3 on same page (preferred) | |
<a href="" class="spu-open-3" title="Click here">Click here</a> | |
// Another way | |
<a href="#spu-3" title="Click here">Click here</a> | |
// To go to a new page and open a popup there | |
<a href="http://mydomain.com/new-page/#spu-3" title="Click here">Click here</a> |
This file contains 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 javascript into WordPress posts or popups | |
// use shortcode [wpp_insert] | |
add_shortcode( 'wpp_insert', 'wpp_insert_code' ); | |
function wpp_insert_code() { | |
ob_start(); | |
?> | |
<!-- paste your html and javascript here --> | |
<?php | |
$html = ob_get_clean(); | |
return $html; |
This file contains 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 | |
// cancel geotargeted posts on certain pages | |
add_filter('geot/cancel_posts_where', 'geotwp_cancel_geo' ); | |
function geotwp_cancel_geo( $query ) { | |
// cancel for every page that is not search | |
if( ! is_page('search') ) { | |
return true; |
This file contains 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 // <-- don't add this in your functions.php if already there | |
/** | |
* https://wordpress.org/support/plugin/popups | |
* Allow editors to edit popups | |
* For more roles check https://codex.wordpress.org/Roles_and_Capabilities | |
*/ | |
add_filter('spu/settings_page/roles', 'my_custom_role'); | |
function my_custom_role(){ | |
return 'edit_others_posts'; | |
} |
This file contains 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 // don't add this tag | |
// Print javascript code in the footer of the site to trigger the popup upon form submission | |
add_action('wp_footer', 'add_popups_trigger_code',150 ); | |
function add_popups_trigger_code(){ | |
// show code on certain page, comment out to print code on every page | |
if( ! is_page('520') ) | |
return; | |
?> | |
<script> |
This file contains 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 // don't add this tag | |
// Print javascript code in the footer of the site to trigger the popup upon form submission | |
add_action('wp_footer', 'add_popups_trigger_code',150 ); | |
function add_popups_trigger_code(){ | |
// show code on certain page, comment out to print code on every page | |
if( ! is_page(520) ) | |
return; | |
?> | |
<script> |
This file contains 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 // don' add this tag | |
// Open popup after WpForms submission | |
add_action( 'wpforms_process_complete_534', 'spu_popup_trigger' ); | |
function spu_popup_trigger(){ | |
add_action('wp_footer','spu_open_popup',99); | |
} | |
function spu_open_popup(){ | |
echo '<script>setTimeout(function(){SPU.show(529)},1000);</script>'; | |
} |
This file contains 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 | |
// Print javascript code in the footer of the site to trigger the popup upon form submission | |
add_action('wp_footer', 'add_popups_trigger_code',150 ); | |
function add_popups_trigger_code(){ | |
// show code on certain page, comment out to print code on every page | |
if( ! is_page('520') ) | |
return; | |
?> | |
<script> | |
document.addEventListener( 'wpcf7mailsent', function( event ) { |
This file contains 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 | |
/** | |
* Geotargeting Plugin. https://wordpress.org/plugins/geotargeting/ | |
* Filter IP if you are for example in local host | |
*/ | |
add_filter( 'geot/user_ip', 'geot_ip'); | |
function geot_ip( $ip ) { | |
return '192.192.192.192'; | |
} |