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 any category is deleted move all attached posts into trash | |
*/ | |
function trash_category_posts($object_id, $tt_ids) | |
{ | |
/** | |
* 1. Check the post_type | |
* 2. Check the action is delete or delete-tag | |
* 3. Check the taxonomy type is "category" |
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 query string from static resource | |
* @param type $src | |
* @return type | |
*/ | |
function _remove_script_version($src) | |
{ | |
$return = $src; |
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 | |
/** | |
* Prepend taxonomy name before feed title for Articles | |
* This will work for any custom post type or custom taxonomy | |
*/ | |
function add_feed_item_title($content) | |
{ | |
global $wp_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 | |
// Set a veriable for redirection (Optional) | |
$redirect_to = ''; | |
/** | |
* WordPress Auto login script | |
*/ | |
if(!is_user_logged_in()) | |
{ |
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 | |
/** | |
* Common Settings for widgets across whole project | |
* @reference : http://www.yiiframework.com/doc/api/1.1/CWidgetFactory | |
* Based on Bootstrap CSS class | |
*/ | |
return array( | |
'components' => array( | |
'widgetFactory' => array( // Default properties for some widgets |
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 | |
namespace console\controllers; | |
use Yii; | |
/** | |
* Controller to Generate base models | |
* NOTE : make sure you are using Development Environment. | |
* @author digitize |
NewerOlder