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 | |
function lol( $content ) { | |
return str_replace( ', ', ', LOL ', $content, 0 ); | |
} | |
add_filter( 'the_content', 'lol' ); | |
?> |
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 | |
function get_a_users_settings() { | |
// Change 1 to the user's ID | |
// Or do $user = wp_get_current_user() and change $user_id in get_user_option to $user->ID | |
$user_id = 1; | |
$option = get_user_option( 'user-settings', $user_id ); | |
if ( $option && is_string( $option ) ) { | |
parse_str( $option, $array ); | |
echo '<pre>'; | |
var_dump( $array ); |
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
## 3.6 Proposed Points from <devchat> | |
# Autosave | |
- We should never lose anything EVER. | |
- Seriously. EVER. | |
- Details TBD. | |
# Distraction-Free Writing | |
- Smoother transitions. It feels like a separate screen | |
- More easily discoverable |
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 hide_my_old_shortcode( $attr, $content ) { | |
return; | |
} | |
add_shortcode( 'my_old_shortcode', 'hide_my_old_shortcode' ); |
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 | |
$query = get_transient( 'video_query' ); | |
if ( false == $query ) { | |
$query = new WP_Query( $args ); | |
set_transient( 'video_query', $query, HOUR_IN_SECONDS ); | |
} | |
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); |
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 | |
/** | |
* This script forces download on the specified file-types. | |
* It was been slightly modified to provide more security from | |
* unauthorized files such as those with a .php extension being | |
* downloaded, or force-download.php itself being exposed. | |
* | |
* http://creativecommons.org/licenses/by/3.0/ | |
* | |
* Original Author: Louai Munajim |
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
/** | |
* Unregister Core Widgets | |
* | |
* Unregisters all core widgets based on their individual | |
* class names. | |
* | |
* @uses unregister_widget() to unregister from the Widget Factory class | |
*/ | |
function remove_core_widgets() { | |
unregister_widget( 'WP_Widget_Calendar' ); |
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 plupload_scaling( $defaults ) { | |
$defaults['resize'] = array( | |
'width' => 1024, | |
'height' => 1024, | |
'quality' => 100 | |
); | |
return $defaults; | |
} | |
add_filter( 'plupload_default_settings', 'plupload_scaling' ); |
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
/** | |
* #content references the outer container selector | |
* .post references in the inner containers selectors | |
*/ | |
jQuery(document).ready(function(){ | |
jQuery( '#content' ).masonry({ | |
itemSelector: '.post', | |
columnWidth: 320 | |
}); |