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 in wp-config.php | |
define('FS_METHOD', 'direct'); | |
define('WP_HTTP_BLOCK_EXTERNAL', true); | |
/* from console | |
$ cd /var/www/ | |
$ sudo chown -R www-data:www-data wordpress |
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 | |
$actions = array(); | |
function add_action($hook, $function) { | |
global $actions; | |
if (! isset($actions[$hook])) | |
$actions[$hook] = array(); |
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 | |
function my_single_template_by_post_id( $located_template ) { | |
return locate_template( array( sprintf( "single-%d.php", absint( get_the_ID() ) ), $located_template ) ); | |
} | |
add_filter( 'single_template', 'my_single_template_by_post_id' ); |
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 | |
//Use this function to create pagingation links that are styleable with Twitter Bootstrap | |
function paging() { | |
global $wp_query; | |
$total_pages = $wp_query->max_num_pages; | |
if ($total_pages > 1){ | |
$current_page = max(1, get_query_var('paged')); |
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
jQuery(document).ready(function() { | |
jQuery("input, textarea").each(function() { | |
jQuery(this).data('holder', jQuery(this).attr('placeholder')); | |
jQuery(this).focusin(function() { | |
jQuery(this).attr('placeholder', ''); | |
}); | |
jQuery(this).focusout(function() { | |
jQuery(this).attr('placeholder', jQuery(this).data('holder')); |
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 | |
/** | |
* ========================= | |
* defaultTemplateByParentTv | |
* ========================= | |
* | |
* Plugin for modX Revolution | |
* Set default template for children of a ressource | |
* | |
* Author: |
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
<h2>Resource Form</h2> | |
<p>[[+fi.error.error_message]]</p> | |
<form class="form" action="[[~[[*id]]]]" method="post"> | |
<input name="nospam:blank" type="hidden" /> | |
<input name="resource_id" type="hidden" value="[[+fi.id]]" /> | |
<label for="parent">Parent: <span class="error">[[+fi.error.parent]]</span></label> | |
<input id="parent" name="parent:required" type="text" value="[[+fi.parent]]" /> | |
<br/> |
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 | |
$month_arr = array('01' => 'Янв', | |
'02' => 'Фев', | |
'03' => 'Мар', | |
'04' => 'Апр', | |
'05' => 'Мая', | |
'06' => 'Июн', | |
'07' => 'Июл', | |
'08' => 'Авг', | |
'09' => 'Сен', |
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
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?php |
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
function list_hooked_functions($tag=false){ | |
global $wp_filter; | |
if ($tag) { | |
$hook[$tag]=$wp_filter[$tag]; | |
if (!is_array($hook[$tag])) { | |
trigger_error("Nothing found for '$tag' hook", E_USER_WARNING); | |
return; | |
} | |
} | |
else { |
OlderNewer