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 script adds a bulk action on post listing screen. When applied, it updates the slugs of selected translations with | |
* the slugs of corresponding english translations. Whole idea is to have same slugs for every translation with only difference | |
* of /language. For example | |
* /test | |
* /fr/test | |
* /de/test | |
* | |
* @author mohsinrasool | |
*/ |
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
/** | |
* Javascript added in admin screens | |
* 1. Enable the "Minor edit - dont'update translation" by WPML checkbox by default on post editing screen | |
* | |
* @return void | |
* @author mohsinrasool | |
**/ | |
add_action('admin_footer', 'mr_admin_footer'); | |
function mr_admin_footer() |
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 script deletes all the provided files from FTP server. | |
* | |
* Application: This script helps when server is being compromised and several malicious files has detected. Some common spams are | |
* | |
* HG.PHP.Shell.25968.UNOFFICIAL | |
* JCDEF.Obfus.CreateFunc.BackDoorEval-23 | |
* JCDEF.Obfus.CreateFunc.BackDoorEval-26 | |
* JCDEF.Obfus.CreateFunc.BackDoorEval-21 |
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
/** | |
* Displays Assigned Cleverness todos in WP Full Calendar | |
* | |
* @return $items | |
* @author Mohsin Rasool | |
**/ | |
add_filter( 'wpfc_events', 'wpfc_add_tasks' ); | |
add_filter( 'wpfc_ajax', 'wpfc_add_tasks' ); |
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
/** | |
* Post multi-dimensional array to a URL using PHP Curl. | |
* Usage: | |
* $req = new MultiDimArrayPost(); | |
* $req->postToURL('http://xyz.com/post',$_POST); | |
* | |
* @package default | |
* @author Mohsin Rasool | |
* | |
**/ |
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 | |
/** | |
* It recursively includes all the files in the specified directory $dir and skips the ones in $skipFiles array | |
* Usage: | |
* include_files(dirname(__FILE__)."/models", $skipFiles); | |
* | |
* @return void | |
* @author Mohsin Rasool | |
* |
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
/** | |
* Usage: <year-select offset=0 range=10 /> | |
* | |
*/ | |
app.directive('yearSelect',function(){ | |
var currentYear = new Date().getFullYear(); | |
return { | |
restrict: 'AE', | |
replace: 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
/** | |
* Usage <year-select range=10 offset=0 /> | |
* | |
* | |
*/ | |
app.directive('monthSelect',function(){ | |
return { |
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
-- Try 1: | |
-- Change DB_CHARSET from utf-8 to latin1 in wp-config.php | |
-- define('DB_CHARSET', 'latin1'); | |
-- Try 2: | |
-- Clean up post_content | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '“', '“'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, 'â€', '”'); | |
UPDATE wp_posts SET post_content = REPLACE(post_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
/** Angular JS datepicker fix for mssql dates | |
* | |
*/ | |
app.directive('datepickerLocaldate', ['$parse', function ($parse) { | |
var directive = { | |
restrict: 'A', | |
require: ['ngModel'], | |
link: link | |
}; |
OlderNewer