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
<a href="mailto:%%meta_email%%">%%meta_email%%</a> | |
<a href="%%meta_website%%">%%meta_website%%%</a> |
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 pb_custom_email(){ | |
$content = <<<EOD | |
<h1>Hello to our site</h1> | |
<p>Something interesting to tell to our new registered user</p> | |
<img src="https://www.google.com/images/srpr/logo3w.png" alt="the google logo" /> | |
EOD; | |
return $content | |
} | |
add_filter("wppb_register_email_content", "pb_custom_email"); |
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 pb_send_email_on_profile_update($user_id, $old_user_data){ | |
$message = "$user_id updated their profile"; | |
wp_mail('[email protected]', 'The subject', $message); | |
} | |
add_action("profile_update", "pb_send_email_on_profile_update", 10, 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
function oembed_filter( $content) { | |
global $wp_embed; | |
add_filter( 'embed_oembed_discover', '__return_false', 999 ); | |
$comment_text = $wp_embed->autoembed( $content ); | |
remove_filter( 'embed_oembed_discover', '__return_false', 999 ); | |
return $content; | |
} | |
add_filter( 'the_content', 'oembed_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
function osu_author_bio($value, $user_id) { | |
return nl2br($value); // this PHP function should read newlines (n) and output HTML breaks | |
} | |
add_filter('get_the_author_description', 'osu_author_bio', 10, 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
$current_user = wp_get_current_user(); | |
if ( 0 == $current_user->ID ) { | |
// Not logged in. Can't comment | |
} else { | |
$birthday = get_user_meta($current_user->ID, 'birthday-your-unique-slug', true); | |
if ($birthday >= 18) { | |
//display comment form | |
} else { | |
// DO NOT display comment form | |
} |
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 | |
/** | |
* Custom Menu Walker - Special Walker classes that manipulate the menus. | |
* | |
* WordPress uses a special “Walker” class that iterates over each data record and then displays this | |
* record accordingly. The cool thing about that is that we can simply create our own custom walker extending | |
* that PHP class. That way we dont need to care about fetching the stuff from the database or preparing the | |
* data arrays. We only need to extend the part of the wordpress code that outputs the list. | |
* | |
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU |
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: Profile Builder Custom Page Title on Single User | |
Plugin URI: http://cozmoslabs.com | |
Description: Filter wp_title on the Single User Listing | |
Author: Cristian Antohe | |
Version: 1.0 | |
Author URI: http://cozmoslabs.com | |
*/ |
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
register_nav_menus( array( | |
'logged-in' => __( 'Logged-in Menu Area', 'yourtheme' ), | |
'visitor' => __( 'Visitor Menu Area', 'yourtheme' ), | |
)); |
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
if (is_user_logged_in()){ | |
wp_nav_menu( array( | |
'menu' => 'Logged In Menu', | |
'container_class' => 'logged-in-menu', | |
'theme_location' => 'logged-in' | |
)); | |
} else { | |
wp_nav_menu( array( | |
'menu' => 'Visitor Menu', | |
'container_class' => 'visitor-menu', |
OlderNewer