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
add_action('admin_init', 'sensei_prevent_admin_access'); | |
function sensei_prevent_admin_access() { | |
if ( ! is_ajax() && ! current_user_can('edit_posts') ) { | |
global $woothemes_sensei; | |
wp_safe_redirect(get_permalink(intval( $woothemes_sensei->settings->settings[ 'course_page' ] ))); | |
exit; | |
} | |
} |
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
/** | |
* JS version of PHP htmlentities. | |
* | |
* @since 1.0.8 | |
* @access public | |
*/ | |
jQuery.fn.htmlentities = function( str ) { | |
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"'); | |
} |
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
/** | |
* sensei_filter_lessons_archive function. | |
* @access public | |
* @param mixed $wp_query | |
* @return void | |
*/ | |
function sensei_filter_lessons_archive( $wp_query ) { | |
// Handle lesson archive page | |
if ( is_post_type_archive( 'lesson' ) ) { |
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
add_filter('register', 'my_custom_registration_link'); | |
function my_custom_registration_link($link) { | |
if(!is_user_logged_in()) { | |
// In this example there is a page with slug 'register' so the url would be http://mysite.com/register | |
$link = '<div class="status register"><a href="' . site_url('register') . '">' . __('Register') . '</a></div>'; | |
} | |
return $link; | |
} // End my_custom_registration_link() |
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
add_action( 'init', 'modify_existing_post_type', 50 ); | |
/** | |
* Modify Existing post type. | |
* | |
* @access public | |
* @param string $token | |
* @param string 'Features' | |
* @param string 'Features' | |
* @param array $supports | |
* @return void |
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
add_action( 'after_setup_theme', 'woothemes_setup' ); | |
if ( ! function_exists( 'woothemes_setup' ) ) { | |
function woothemes_setup () { | |
// This theme styles the visual editor with editor-style.css to match the theme style. | |
if ( locate_template( 'editor-style.css' ) != '' ) { add_editor_style(); } | |
// Add default posts and comments RSS feed links to head | |
add_theme_support( 'automatic-feed-links' ); |
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
$style = ''; | |
$featured_height = ''; | |
if ( '' != $image_bg ) { | |
if ( '' == $title && '' == $content && '' == $embed ) { | |
$featured_height_id = get_post_thumbnail_id(); | |
$featured_height = wp_get_attachment_image_src( $featured_height_id, 'large' ); | |
$featured_height = ' height: ' . $featured_height[ 2 ] . 'px;'; | |
} | |
$style = ' style="background-size: cover; background-image: url(' . $image_bg . ');' . $featured_height . '"'; | |
} |
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
$style = ''; | |
$featured_height = ''; | |
if ( '' != $image_bg ) { | |
$featured_height_id = get_post_thumbnail_id(); | |
$featured_height = wp_get_attachment_image_src( $featured_height_id, 'large' ); | |
$featured_height = ' height: ' . $featured_height[ 2 ] . 'px;'; | |
$style = ' style="background-size: cover; background-image: url(' . $image_bg . ');' . $featured_height . '"'; | |
} |
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 | |
global $wpdb; | |
$ID = $_GET['ID']; | |
$sql = "SELECT post_title from $wpdb->posts WHERE ID = '$ID';"; | |
?> |
OlderNewer