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 ) { |
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 | |
/** | |
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 | |
// 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 // 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 | |
/** | |
* A utility script to load WordPress to run | |
* php scripts directly from the 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 | |
/** | |
* WP-Members Admin API Functions | |
* | |
* This file is part of the WP-Members plugin by Chad Butler | |
* You can find out more about this plugin at https://rocketgeek.com | |
* Copyright (c) 2006-2022 Chad Butler | |
* WP-Members(tm) is a trademark of butlerblog.com | |
* | |
* @package WP-Members |
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
# No dirs: | |
rm -- !(file.txt) | |
# If dirs: | |
rm -rf -- !(file.txt) | |
# If extglob is not enabled: | |
shopt -s extglob |
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
:: This is for spinning up installs for dev work, so don't consider this for | |
:: production applications. It creates everything off a single entry variable | |
:: so that you don't have to mess with unnecessary details. The site name and | |
:: username are the same (a single input), as are the database and db user. | |
:: The passwords for the initial WP user and the db user are generic "pass". | |
:: PHP, WP-CLI, and MYSQL all need to be path environment variables. | |
:: If you get errors that indicate something is not recognized as an internal | |
:: or external command, make sure you have these in your 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 | |
/** | |
* An object class for WP-Members Password Reset. | |
* | |
* @since 3.3.5 | |
* @since 3.3.8 Rebuild processing to utilize WP native functions and user_activation_key. | |
*/ | |
class WP_Members_Pwd_Reset { | |
/** |
OlderNewer