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 | |
// table, $where, $where_format | |
$wpdb->delete( | |
$wpdb->posts, | |
array( | |
'ID' => 5 | |
), | |
array( | |
'%d' | |
) |
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 | |
// table, $data, $where, $format, $where_format | |
$wpdb->update( | |
$wpdb->postmeta, | |
array( | |
'meta_value' => 'false' | |
), | |
array( | |
'post_id' => 5, | |
'meta_key' => '_custom_meta_key', |
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 | |
// table, $data, $format | |
$wpdb->insert( | |
$wpdb->postmeta, | |
array( | |
'post_id' => '5', | |
'meta_key' => '_custom_meta_key', | |
'meta_value' => 'true' | |
), | |
array( |
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 = "'; SELECT * FROM wp_users WHERE 1 = '1"; | |
$sql = "SELECT post_title from $wpdb->posts WHERE ID = '$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 | |
global $wpdb; | |
$ID = $_GET['ID']; | |
$sql = "SELECT post_title from $wpdb->posts WHERE ID = '$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
$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
$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
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
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_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() |