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 | |
/** | |
* Comment fields position order handler | |
* @param array $form Form fields | |
* @author Mostafa Soufi <mostafa.soufi@hotmail.com> | |
* @link (http://mostafa-soufi.ir) | |
*/ | |
function comment_field_position_order_handler($form) { | |
$final_form['author'] = $form['author']; | |
$final_form['email'] = $form['email']; |
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 post status to draft if post is not complete | |
* @param integer $post_id Post ID | |
* @param object $post Post Object | |
* @author Mostafa Soufi <mostafa.soufi@hotmail.com> | |
*/ | |
function validate_post_field($post_id, $post) { | |
// Check post status | |
if( $post->post_status != 'publish' ) |
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 | |
/** | |
* Modify wordpress mime types | |
* @param array $existing_mimes current mimes | |
*/ | |
function modify_mime_type($existing_mimes){ | |
return array_merge($existing_mimes, array( | |
'7z' => 'application/x-7z-compressed', | |
'rar' => 'package/rar', | |
'tar' => 'package/x-tar', |
NewerOlder