note: I have found out that some functions that are available in some sources may not be available in these resources I have listed.
This file contains 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
/* | |
* | |
* Allows contributors to see and manage only their custom post types and drafts from the manage posts screen. | |
* src: https://wordpress.stackexchange.com/questions/89233/restrict-contributors-to-view-only-their-own-custom-post-types | |
* | |
*/ | |
add_action( 'pre_get_posts', 'aet_filter_cpt_listing_by_author' ); | |
function aet_filter_cpt_listing_by_author( $wp_query_obj ){ | |
// Front end, do nothing | |
if( !is_admin() ) |
This file contains 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 Restrict Post Types for Visitors and Specific Roles and Show Restricted Content Notice. | |
*/ | |
function yzc_restrict_content( $content = null, $activity = null ) { | |
// Add Forbidden post types! | |
$forbidden_posts = array( 'activity_photo' ); | |
// Add Forbidden roles. |
This file contains 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 | |
/* | |
* Enable commenting on new blog post. | |
*/ | |
function yz_enable_new_blog_posts_commenting( $can_comment, $activity_type ) { | |
if ( $activity_type == 'new_blog_post' ) { | |
return true; | |
} |
This file contains 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 | |
/** | |
* Change Profile Posts Tab Post Type | |
*/ | |
function yzc_change_posts_tab_post_type() { | |
// Add Post Type Here Below. | |
return 'recipes'; | |
} |
This file contains 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 | |
// Show related posts. | |
// Fetch taxonomy terms for current product. | |
$productterms = get_the_terms( get_the_ID(), 'work_categories' ); | |
if( $productterms ) { | |
$producttermnames[] = 0; | |
foreach( $productterms as $productterm ) { | |
$producttermnames[] = $productterm->name; | |
} | |
// Set up the query arguments. |
This file contains 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 | |
/** | |
* Plugin Name: [Smush] - Bulk Delete Bak Images | |
* Plugin URI: https://premium.wpmudev.org/ | |
* Description: Deletes all .bak images | |
* Author: Panos Lyrakis @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org/ | |
* License: GPLv2 or later | |
*/ |
This file contains 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 | |
/** | |
* Custom Widget. | |
**/ | |
function yzc_get_ads_widget() { | |
if ( ! bp_is_single_activity() ) { | |
return; | |
} |
This file contains 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 | |
/** | |
* Change Activity Excerpt Words Length | |
*/ | |
function yzc_change_activity_excerpt_length() { | |
// By default it's : 358 Character length. | |
return 400; | |
} |
NewerOlder