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 | |
add_action( 'post_submitbox_misc_actions', 'without_update_post_modified_datetime' ); | |
function without_update_post_modified_datetime($post) | |
{ | |
echo '<div class="misc-pub-section misc-pub-section-last"><span><label><input type="checkbox" value="yes" name="without_update_post_modified_datetime" /> Stop updating post modified date</label></span></div>'; | |
echo '<div class="misc-pub-section misc-pub-section-last"><span><label>Last modified: '.get_the_modified_time('Y/m/d H:i:s', $post).'</label></span></div>'; | |
} | |
function without_update_post_modified_datetime_save_postdata($data, $postarr) | |
{ | |
$postid = (!empty($postarr['ID']) && intval($postarr['ID'] > 0) ? intval($postarr['ID']) : (!empty($data['ID']) && intval($data['ID']) > 0 ? intval($data['ID']) : null)); |
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
using System; | |
using System.Text.RegularExpressions; | |
public class Test | |
{ | |
public bool AddToTexBoxOfLine(TextBox box, int lineNumber, string text) | |
{ | |
if (lineNumber <= 0) | |
throw new Exception("The number must be 1 or larger\nNumbers smaller than 1 are not acceptable"); |
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 | |
/* | |
**** into functions.php **** | |
Example: | |
redirect tiny url: http://site.com/?p=1 | |
to long post slug: http://site.com/my-post/ | |
*/ | |
add_action('template_redirect', 'redirect_tiny_url_to_long'); | |
function redirect_tiny_url_to_long(){ | |
if(is_single()){ |