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 | |
// Custom shortcode to add logout link with optional redirect URL and link text attributes | |
// Defaults: [intw_logout redirect="HOME PAGE" text="Logout"] | |
add_shortcode( 'intw_logout', 'intw_logout_shortcode_func' ); | |
function intw_logout_shortcode_func( $atts ) { | |
$homepage = get_bloginfo('url'); | |
extract( shortcode_atts( array( | |
'redirect' => $homepage, | |
'text' => 'Logout', |
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 | |
// Custom shortcode to display user meta for currently logged in user | |
add_shortcode('intw_user_meta', 'intw_user_meta_func'); | |
function intw_user_meta_func($atts) { | |
if ( is_user_logged_in() ) { | |
$current_user = wp_get_current_user(); | |
$content = '<p>Welcome, ' . $current_user->display_name . '!</p>'; | |
return $content; | |
} |
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 | |
// Custom Builder module CSS classes for styling | |
if ( ! function_exists( 'it_builder_loaded' ) ) { | |
add_action( 'it_libraries_loaded', 'it_builder_loaded' ); | |
function it_builder_loaded() { | |
builder_register_module_style( array('html','widget-bar','content'), 'Sample Style Name', 'sample-style-class' ); | |
} | |
} |
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 | |
// Hook right after opening <body> tag | |
add_action('builder_layout_engine_render_header', 'intw_add_after_opening_body', 20 ); | |
function intw_add_after_opening_body() { ?> | |
HTML code that you want just after the opening body tag should be placed here | |
<?php } | |
// Hook right before closing </body> tag | |
add_action('builder_finish', 'intw_add_before_closing_body', 0 ); | |
function intw_add_before_closing_body() { ?> |
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 | |
// Modify default widget wrappers | |
add_filter( 'builder_filter_register_sidebar_options', 'intw_modify_widget_wrappers' ); | |
function intw_modify_widget_wrappers( $options ) { | |
$options['before_title'] = '<div class="widget-title">'; | |
$options['after_title'] = '</div>'; | |
return $options; | |
} | |
?> |
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 | |
// This function will return true if we are looking at the page in question or one of its sub pages | |
function is_tree( $pid ) { // $pid = The ID of the page we're looking for pages underneath | |
global $post; // load details about this page | |
if ( is_page($pid) ) | |
return TRUE; // we're at the page or at a sub page | |
$anc = get_post_ancestors( $post->ID ); |
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 | |
class Intw_User_Caps { | |
// Add our filters | |
function Intw_User_Caps(){ | |
add_filter( 'editable_roles', array(&$this, 'editable_roles')); | |
add_filter( 'map_meta_cap', array(&$this, 'map_meta_cap'),10,4); | |
} |
OlderNewer