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 | |
/** | |
* Create a MemberPress Member trans and subscr record to activate a user. | |
* | |
* @param int $user_id WP_User id. | |
* @param int $membership_id WP_Post id. | |
* @return void | |
*/ | |
function create_memberpress_member( $user_id, $membership_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 | |
function render_sub_menu_toggle( $item_output, $item, $depth, $args ) { | |
$children = false; | |
// If menu is using a walker. | |
// Walker class has children method. | |
if ( $args->walker->has_children ) { | |
$children = 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
RewriteEngine On | |
# This will enable the Rewrite capabilities | |
RewriteOptions InheritDownBefore | |
# This prevents the rule from being overrided by .htaccess files in subdirectories. | |
RewriteCond %{HTTPS} !=on | |
# This checks to make sure the connection is not already HTTPS | |
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [QSA,R,L] |
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 | |
$options = [ | |
'theme_my_login' => [ | |
'allow_update' => true, | |
'dismissed_notices' => true, | |
], | |
'wordpress_api_key' => '1', // Akismet API Key. | |
'akismet_comment_form_privacy_notice' => 'hide', | |
'akismet_strictness' => 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 | |
/** | |
* Get an array of WP_Term objects for a post. | |
* | |
* @param integer $post_id The post id. | |
* @return array | |
*/ | |
function get_post_terms( $post_id ) { | |
$terms_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
<?php | |
/** | |
* Filter the archive posts to only display posts of the current Term not child Terms. | |
* | |
* @param WP_Query $query The query instance. | |
* @return void | |
*/ | |
function filter_archive_posts( $query ) { |
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 | |
/** | |
* Add 'Featured Image' to a rss feed. | |
* | |
* @return void | |
*/ | |
function add_feed_item() { | |
$query = get_queried_object(); |
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 | |
/** | |
* Remove text from rss feed content and excerpt. | |
* | |
* @param string $content | |
* @return string | |
*/ | |
function remove_feed_text( $content ) { |
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 | |
/** | |
* Exclude some terms from the term lists. | |
* | |
* @param WP_Term_Query $term_query The class instance instance. | |
* @return void | |
*/ | |
function exclude_terms( $term_query ) { | |
if ( | |
is_feed() || |
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 | |
global $wp_styles; | |
global $wp_scripts; | |
echo '<pre>' . print_r( $wp_styles->queue, true ) . '</pre>'; | |
echo '<pre>' . print_r( $wp_scripts->queue, true ) . '</pre>'; |
NewerOlder