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 | |
$file = __DIR__ . '/text.txt'; | |
if (is_file($file) && is_writable($file)) { | |
@unlink($file); | |
echo '<small style="color: #ccc;">' . $file . ' was deleted.</small><br>' . PHP_EOL; | |
} | |
echo '<p>Calling to <code>fastcgi_finish_request()</code>.</p>' . PHP_EOL; |
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 cbstdsys_add_icon_classes_by_post_type_and_format( $classes ) { | |
global $post; | |
switch ( $post->post_type ) { | |
case 'post' : | |
if ( is_sticky( $post->ID ) ) { | |
$classes[] = 'icon-alert'; | |
return $classes; | |
} |
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
/** WPML - Sitepress Multilingual CMS **/ | |
global $sitepress; | |
// remove language switcher, 'cause it messes with the WP backend styles | |
remove_action('in_admin_header', array($sitepress, 'admin_language_switcher')); | |
// remove meta-generator tag | |
remove_action('wp_head', array($sitepress, 'meta_generator_tag')); | |
// WPML sitepress-multilingual-cms | |
define( 'ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS' , true); |
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
// Block direct requests | |
defined( 'ABSPATH' ) or die( '-1' ); | |
?> | |
<p> | |
<label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:'); ?></label> | |
<select class="contentwidget_post_type widefat" id="<?php echo $this->get_field_id('post_type'); ?>" name="<?php echo $this->get_field_name('post_type'); ?>"> | |
<?php | |
$post_types = get_post_types( array( 'public' => true ), 'object' ); | |
// Do not list any attachements | |
unset( $post_types['attachment'] ); |
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
### Using Git with WordPress Plugin Development ### | |
# receive revision-number from WordPress Repository | |
svn log -r 1:HEAD --limit 1 http://plugins.svn.wordpress.org/your-plug-in-name | |
# clone to local folder | |
git svn clone -s -r<rev-number> --no-minimize-url https://plugins.svn.wordpress.org/<plugin-path> | |
# change to directory | |
cd <plugin-path> |
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 countdown_shortcode ( $atts ) { | |
extract( shortcode_atts( array( | |
'date' => '', | |
), $atts ) ); | |
if ( !isset($date) ) | |
return false; | |
return '<span class="countdown">'.floor( ( strtotime( $date ) - time() )/60/60/24 ).'</span>'; |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<!-- To import this information into a WordPress site follow these steps: --> | |
<!--RUN THIS FILE IN FIREFOX OR IE--> | |
<!--VIEW PAGE SOURCE--> | |
<!--COPY-PASTE PAGE SOURCE INTO TEXT EDITOR AND SAVE AS .WXR FILE--> | |
<!--REMOVE "?'s" FROM XML VERSION AT TOP OF THIS PAGE--> | |
<!--COMMENT OUT LINE 1309, 1310, 1311 IN wp-includes/kses.php --> | |
<!--THEN FOLLOW THE STEPS BELOW--> |
NewerOlder