- Added related post id as second argument to 'rp4wp_post_excerpt' filter.
- Only run upgrade script if there are posts to upgrade.
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
add_filter( 'rp4wp_disable_css', '__return_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
<?php | |
$ch = curl_init(); | |
curl_setopt( $ch, CURLOPT_URL, "example.com" ); | |
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); | |
$output = curl_exec( $ch ); | |
curl_close( $ch ); | |
var_dump( $output ); |
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
define('WP_DEBUG', true); | |
if ( WP_DEBUG ) { | |
/** | |
* Turn on error logging and show errors on-screen if in debugging mode | |
*/ | |
@error_reporting( E_ALL ); | |
@ini_set( 'log_errors', true ); | |
@ini_set( 'log_errors_max_len', '0' ); |
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 | |
for ( $i = 1; $i < 13; $i ++ ) { | |
$N = date( 'N', strtotime( '01-' . $i . '-2015' ) ); | |
$d=1; | |
if ( $N > 1 ) { | |
$d = ( 7 - $N ) + 2; |
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 | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
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 | |
// The changelog path | |
$changelog_path = '/var/www/rp4wp/wp-content/plugins/related-posts-for-wp-premium/CHANGELOG.md'; | |
// Format the changelog from .md to HTML | |
$changelog = file_get_contents( $changelog_path ); | |
$changelog = preg_replace( "/###[ ]?([0-9\.]+): ([A-Z0-9 ,]+)/i", "<h3>$1</h3>" . PHP_EOL . "<i>$2</i>" . PHP_EOL . "<ul>", $changelog ); | |
$changelog = preg_replace( "/\* ([A-Z0-9 \._,'\(\)\/\-&\"\']+)/i", "<li>$1</li>", $changelog ); | |
$changelog = preg_replace( "/" . PHP_EOL . "<h3>/i", "</ul>" . PHP_EOL . PHP_EOL . "<h3>", $changelog ); |
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 works | |
*/ | |
add_option( 'verykey', 'wow' ); // Stored with key 'verykey' | |
echo get_option( 'verykey', '' ); // Outputs 'wow' | |
/** |
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 | |
if ( true == $result ) { | |
// Do something | |
} |
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 | |
$shout = ( 'WordPress' === $cms ) ? 'Woo!' : 'Boo!'; |