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 // do not include this line. Replace the function is_blocked() in class-wp-members.php with the below: | |
/** | |
* Determines if content should be blocked. | |
* | |
* This function was originally stand alone in the core file and | |
* was moved to the WP_Members class in 3.0. | |
* | |
* @since 3.0.0 | |
* @since 3.3.0 Added $post_id |
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 | |
// Extraction utility for getting attributes from HTML tag. | |
function extract_html_atts( $string, $prefix = "data-" ) { | |
$start = 0; | |
$end = 0; | |
while( strpos( $string, $prefix, $end ) ) { | |
$start = strpos( $string, $prefix, $start )+strlen( $prefix ); | |
$end = strpos( $string, '"', $start )-1; |
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 is not longer the most recent set of changes. | |
See new gist for additional changes: | |
https://gist.github.com/rocketgeek/6e8329aeaf0f1de26b618bd7d5dc2fe8 | |
**/ |
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 | |
/** | |
* A framework for using the command line for big | |
* WordPress import projects. | |
*/ | |
// Identify that script must run from command line. | |
if (php_sapi_name() !== 'cli') { | |
die("This script is meant to be run from the command line"); | |
} |
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 | |
// https://stackoverflow.com/questions/23062537/how-to-convert-html-to-json-using-php | |
function html_to_obj( $html ) { | |
$dom = new DOMDocument(); | |
$dom->loadHTML( $html ); | |
return element_to_obj( $dom->documentElement ); | |
} | |
function element_to_obj( $element ) { |
NewerOlder