Глобальные изменения WordPress

На данной странице все изменения, которые нужно вносить всякий раз при обновлении WordPress до новой версии.

MySQL

  1. таблица "_posts"
    1. было: post_name - varchar(200)
    2. стало: post_name - varchar(500)
  2. таблица "_terms"
    1. было: slug - varchar(200)
    2. стало: slug - varchar(300)

|-- 1. /wp-includes

|--| 1.1. formatting.php

1.1.1.

Функция: sanitize_title_with_dashes

было:

$title = utf8_uri_encode($title, 200);

стало:

/* cay 1: $title = utf8_uri_encode($title, 200); */
$title = utf8_uri_encode($title, 500);

|--| 1.2. class-wp-editor.php

1.2.1.

было:

if ( $set['dfw'] ) {
	// replace the first 'fullscreen' with 'wp_fullscreen'
	if ( ($key = array_search('fullscreen', $mce_buttons)) !== false )
		$mce_buttons[$key] = 'wp_fullscreen';
	elseif ( ($key = array_search('fullscreen', $mce_buttons_2)) !== false )
		$mce_buttons_2[$key] = 'wp_fullscreen';
	elseif ( ($key = array_search('fullscreen', $mce_buttons_3)) !== false )
		$mce_buttons_3[$key] = 'wp_fullscreen';
	elseif ( ($key = array_search('fullscreen', $mce_buttons_4)) !== false )
		$mce_buttons_4[$key] = 'wp_fullscreen';
}

стало:

if ( $set['dfw'] ) {
	// replace the first 'fullscreen' with 'wp_fullscreen'
	/* cay 1
	if ( ($key = array_search('fullscreen', $mce_buttons)) !== false )
		$mce_buttons[$key] = 'wp_fullscreen';
	elseif ( ($key = array_search('fullscreen', $mce_buttons_2)) !== false )
		$mce_buttons_2[$key] = 'wp_fullscreen';
	elseif ( ($key = array_search('fullscreen', $mce_buttons_3)) !== false )
		$mce_buttons_3[$key] = 'wp_fullscreen';
	elseif ( ($key = array_search('fullscreen', $mce_buttons_4)) !== false )
		$mce_buttons_4[$key] = 'wp_fullscreen';
	*/
}

|--| 1.3. bookmark.php

1.3.1.

было

if ( $hide_invisible )
	$visible = "AND link_visible = 'Y'";

стало

/* cay: -block- */
global $user_level;
if ( $hide_invisible && $user_level < 10 )
	$visible = "AND link_visible = 'Y'";
/* cay: -block- # */

|--| 1.4. bookmark-template.php

1.4.1.

было:

$output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>';

$output .= $link_before;

if ( $bookmark->link_image != null && $show_images ) {
	if ( strpos($bookmark->link_image, 'http') === 0 )
		$output .= "<img src=\"$bookmark->link_image\" $alt $title />";
	else // If it's a relative path
		$output .= "<img src=\"" . get_option('siteurl') . "$bookmark->link_image\" $alt $title />";

	if ( $show_name )
		$output .= " $name";
} else {
	$output .= $name;
}

$output .= $link_after;

$output .= '</a>';

стало:

/* cay: -block- */
$var_start = '';
$var_end = '';
if ( $bookmark->link_visible == 'N' ) {
	//~ $private_title_format = apply_filters('private_title_format', __('Private: %s'));
	//~ $private_title_format = str_replace( 'Личное:', '<var>Личное:</var>', $private_title_format );
	//~ $name = sprintf($private_title_format, $name);
	$var_start = '<var>';
	$var_end = '</var>';
}
$output .= $var_start . '<a href="' . $the_link . '"' . $rel . $title . $target . '>';
/* cay: -block- # */

$output .= $link_before;

if ( $bookmark->link_image != null && $show_images ) {
	if ( strpos($bookmark->link_image, 'http') === 0 )
		$output .= "<img src=\"$bookmark->link_image\" $alt $title />";
	else // If it's a relative path
		$output .= "<img src=\"" . get_option('siteurl') . "$bookmark->link_image\" $alt $title />";

	if ( $show_name )
		$output .= " $name";
} else {
	$output .= $name;
}

$output .= $link_after;

// cay
$output .= '</a>' . $var_end;

1.4.2.

было:

function wp_list_bookmarks($args = '') {
	...
	foreach ( (array) $cats as $cat ) {

стало:

// cay
$output .= '<div id="list_bookmarks">';
foreach ( (array) $cats as $cat ) {
	...
}
// cay
$output .= '</div>';

|--| 1.5. post.php

1.5.1.

было:

function &get_pages($args = '') {
...
	$r = wp_parse_args( $args, $defaults );

стало:

$r = wp_parse_args( $args, $defaults );
// cay: -block-
global $user_level;
if ( $user_level > 9 ) {
	$r[ 'post_status' ] = array( 'publish', 'private' );
}
// cay: -block- #

|--| 1.6. post-template.php

1.6.1.

было:

function start_el(&$output, $page, $depth, $args, $current_page) {
	$output .= $indent . '<li class="' . $css_class . '"><a href="' . get_permalink($page->ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';

стало:

// cay: -block-
$page_link = '<a href="' . get_permalink($page->ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';
if ( $page->post_status == 'private' ) {
	//~ $private_title_format = apply_filters('private_title_format', __('Private: %s'));
	//~ $private_title_format = str_replace( 'Личное:', '<var>Личное:</var>', $private_title_format );
	//~ $page_title = apply_filters( 'the_title', $page->post_title, $page->ID );
	//~ $page_title = sprintf($private_title_format, $page_title);
	$page_link = '<var>' . $page_link . '</var>';
}
$output .= $indent . '<li class="' . $css_class . '">' . $page_link;
// cay: -block- #

|-- 2. /wp-includes/js

|--| 2.1. autosave.js

2.1.1.

было:

function autosave_loading(){

стало:

function autosave_loading(){if(!jQuery('#save-message').length){jQuery('#mce_fullscreen_tbl .mceStatusbar').append('<div id="save-message"></div>');}

2.1.2.

было:

jQuery(".autosave-message").html(autosaveL10n.savingText)

стало:

jQuery(".autosave-message, #save-message").html(autosaveL10n.savingText)

2.1.3.

было:

if(e){jQuery(".autosave-message").html(e)}else{if(autosaveOldMessage&&d){jQuery(".autosave-message").html(autosaveOldMessage)}

стало:

if(e){jQuery(".autosave-message, #save-message").html(e)}else{if(autosaveOldMessage&&d){jQuery(".autosave-message, #save-message").html(autosaveOldMessage)}

2.1.4.

было:

function autosave_enable_buttons(){setTimeout(function(){jQuery(":button, :submit","#submitpost").removeAttr("disabled");jQuery(".ajax-loading").css("visibility","hidden")},500)}function autosave_disable_buttons(){jQuery(":button, :submit","#submitpost").prop("disabled",true);setTimeout(autosave_enable_buttons,5000)}

стало:

function autosave_enable_buttons(){setTimeout(function(){jQuery(":button, :submit","#submitpost").removeAttr("disabled");jQuery(".ajax-loading").css("visibility","hidden");jQuery("#content_save, #mce_fullscreen_save").removeClass("mceButtonDisabled").addClass("mceButtonEnabled");},500)}function autosave_disable_buttons(){jQuery("#content_save, #mce_fullscreen_save").removeClass("mceButtonEnabled").addClass("mceButtonDisabled");jQuery(":button, :submit","#submitpost").prop("disabled",true);setTimeout(autosave_enable_buttons,5000)}

|-- 3. /wp-includes/js/tinymce/plugins/wordpress

|--| 3.1. editor_plugin.js

3.1.1.

было:

alt+shift+u

стало:

ctrl+shift+y

3.1.2.

было:

alt+shift+o

стало:

ctrl+shift+o

3.1.3.

было:

alt+shift+s

стало:

ctrl+shift+S

|-- 4. /wp-includes/js/tinymce/plugins/wplink

|--| 4.1. editor_plugin.js

4.1.1.

было:

alt+shift+a

стало:

ctrl+shift+A

|-- 5. /wp-content/plugins/syntaxhighlighter

|--| 5.1. syntaxhighlighter.php

5.1.1.

было:

// Output any needed scripts. This is meant for the footer.
function maybe_output_scripts() {
	global $wp_styles;

стало:

function maybe_output_scripts() {
	global $wp_styles;

	/* cay -block- */
	$this->usedbrushes = array(
		'php' => 'php',
		'html' => 'xml',
		'xml' => 'xml',
		'sql' => 'sql',
		'text' => 'plain',
		'bash' => 'bash',
		'shell' => 'bash',
		'javascript' => 'jscript',
		'css' => 'css',
		'plain' => 'plain' );
	$this->usedbrushes = array_flip( array_values( $this->usedbrushes ) );
	/* cay -block- # */

|-- 6. /wp-content/plugins/no-curly-quotes

|--| 6.1. nocurlyquotes.php

было:

function get_curly_quotes_options(){
 $options = array();
 $options['no_curly_quotes_title'] = get_option(no_curly_quotes_title);
 $options['no_curly_quotes_content'] = get_option(no_curly_quotes_content);
 $options['no_curly_quotes_excerpt'] = get_option(no_curly_quotes_excerpt);
 $options['no_curly_quotes_comments'] = get_option(no_curly_quotes_comments);

return $options;
}

стало:

function get_curly_quotes_options(){
 $options = array();
 // cay: -block-
 $options['no_curly_quotes_title'] = get_option('no_curly_quotes_title');
 $options['no_curly_quotes_content'] = get_option('no_curly_quotes_content');
 $options['no_curly_quotes_excerpt'] = get_option('no_curly_quotes_excerpt');
 $options['no_curly_quotes_comments'] = get_option('no_curly_quotes_comments');
 // cay: -block- #

return $options;
}

|-- 7. /wp-content/plugins/seo-ultimate/plugin

|--| 7.1. class.seo-ultimate.php

было:

function template_head() {
	
	if ($markcode = $this->get_setting('mark_code', true, 'settings'))
		echo "\n<!-- ".SU_PLUGIN_NAME." (".SU_PLUGIN_URI.") -->\n";
	
	//Let modules output head code.
	do_action('su_head');
	
	//Make sure the blog is public. Telling robots what to do is a moot point if they aren't even seeing the blog.
	if (get_option('blog_public')) {
		$robots = implode(',', apply_filters('su_meta_robots', array()));
		$robots = su_esc_attr($robots);
		
		if ($robots) echo "\t<meta name=\"robots\" content=\"$robots\" />\n";
	}
	
	if ($markcode) echo "<!-- /".SU_PLUGIN_NAME." -->\n\n";
}

стало:

function template_head() {
	
	if ($markcode = $this->get_setting('mark_code', true, 'settings'))
		echo "\n<!-- ".SU_PLUGIN_NAME." (".SU_PLUGIN_URI.") -->\n";
	
	//Let modules output head code.
	do_action('su_head');
	
	//Make sure the blog is public. Telling robots what to do is a moot point if they aren't even seeing the blog.
	if (get_option('blog_public')) {
		$robots = implode(',', apply_filters('su_meta_robots', array()));
		$robots = su_esc_attr($robots);
		// cay: -block-
		if ( strpos( $_SERVER[ 'HTTP_HOST' ], 'ya.sampose.be' ) !== false ) {
			$robots = 'noindex, nofollow';
		}
		// cay: -block- #

		if ($robots) echo "\t<meta name=\"robots\" content=\"$robots\" />\n";
	}
	
	if ($markcode) echo "<!-- /".SU_PLUGIN_NAME." -->\n\n";
}