Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu...
File: general-template.php
'quotmark' => 'single',
[4000] Fix | Delete
'trailing' => true,
[4001] Fix | Delete
'undef' => true,
[4002] Fix | Delete
'unused' => true,
[4003] Fix | Delete
[4004] Fix | Delete
'browser' => true,
[4005] Fix | Delete
[4006] Fix | Delete
'globals' => array(
[4007] Fix | Delete
'_' => false,
[4008] Fix | Delete
'Backbone' => false,
[4009] Fix | Delete
'jQuery' => false,
[4010] Fix | Delete
'JSON' => false,
[4011] Fix | Delete
'wp' => false,
[4012] Fix | Delete
),
[4013] Fix | Delete
),
[4014] Fix | Delete
'htmlhint' => array(
[4015] Fix | Delete
'tagname-lowercase' => true,
[4016] Fix | Delete
'attr-lowercase' => true,
[4017] Fix | Delete
'attr-value-double-quotes' => false,
[4018] Fix | Delete
'doctype-first' => false,
[4019] Fix | Delete
'tag-pair' => true,
[4020] Fix | Delete
'spec-char-escape' => true,
[4021] Fix | Delete
'id-unique' => true,
[4022] Fix | Delete
'src-not-empty' => true,
[4023] Fix | Delete
'attr-no-duplication' => true,
[4024] Fix | Delete
'alt-require' => true,
[4025] Fix | Delete
'space-tab-mixed-disabled' => 'tab',
[4026] Fix | Delete
'attr-unsafe-chars' => true,
[4027] Fix | Delete
),
[4028] Fix | Delete
);
[4029] Fix | Delete
[4030] Fix | Delete
$type = '';
[4031] Fix | Delete
if ( isset( $args['type'] ) ) {
[4032] Fix | Delete
$type = $args['type'];
[4033] Fix | Delete
[4034] Fix | Delete
// Remap MIME types to ones that CodeMirror modes will recognize.
[4035] Fix | Delete
if ( 'application/x-patch' === $type || 'text/x-patch' === $type ) {
[4036] Fix | Delete
$type = 'text/x-diff';
[4037] Fix | Delete
}
[4038] Fix | Delete
} elseif ( isset( $args['file'] ) && str_contains( basename( $args['file'] ), '.' ) ) {
[4039] Fix | Delete
$extension = strtolower( pathinfo( $args['file'], PATHINFO_EXTENSION ) );
[4040] Fix | Delete
foreach ( wp_get_mime_types() as $exts => $mime ) {
[4041] Fix | Delete
if ( preg_match( '!^(' . $exts . ')$!i', $extension ) ) {
[4042] Fix | Delete
$type = $mime;
[4043] Fix | Delete
break;
[4044] Fix | Delete
}
[4045] Fix | Delete
}
[4046] Fix | Delete
[4047] Fix | Delete
// Supply any types that are not matched by wp_get_mime_types().
[4048] Fix | Delete
if ( empty( $type ) ) {
[4049] Fix | Delete
switch ( $extension ) {
[4050] Fix | Delete
case 'conf':
[4051] Fix | Delete
$type = 'text/nginx';
[4052] Fix | Delete
break;
[4053] Fix | Delete
case 'css':
[4054] Fix | Delete
$type = 'text/css';
[4055] Fix | Delete
break;
[4056] Fix | Delete
case 'diff':
[4057] Fix | Delete
case 'patch':
[4058] Fix | Delete
$type = 'text/x-diff';
[4059] Fix | Delete
break;
[4060] Fix | Delete
case 'html':
[4061] Fix | Delete
case 'htm':
[4062] Fix | Delete
$type = 'text/html';
[4063] Fix | Delete
break;
[4064] Fix | Delete
case 'http':
[4065] Fix | Delete
$type = 'message/http';
[4066] Fix | Delete
break;
[4067] Fix | Delete
case 'js':
[4068] Fix | Delete
$type = 'text/javascript';
[4069] Fix | Delete
break;
[4070] Fix | Delete
case 'json':
[4071] Fix | Delete
$type = 'application/json';
[4072] Fix | Delete
break;
[4073] Fix | Delete
case 'jsx':
[4074] Fix | Delete
$type = 'text/jsx';
[4075] Fix | Delete
break;
[4076] Fix | Delete
case 'less':
[4077] Fix | Delete
$type = 'text/x-less';
[4078] Fix | Delete
break;
[4079] Fix | Delete
case 'md':
[4080] Fix | Delete
$type = 'text/x-gfm';
[4081] Fix | Delete
break;
[4082] Fix | Delete
case 'php':
[4083] Fix | Delete
case 'phtml':
[4084] Fix | Delete
case 'php3':
[4085] Fix | Delete
case 'php4':
[4086] Fix | Delete
case 'php5':
[4087] Fix | Delete
case 'php7':
[4088] Fix | Delete
case 'phps':
[4089] Fix | Delete
$type = 'application/x-httpd-php';
[4090] Fix | Delete
break;
[4091] Fix | Delete
case 'scss':
[4092] Fix | Delete
$type = 'text/x-scss';
[4093] Fix | Delete
break;
[4094] Fix | Delete
case 'sass':
[4095] Fix | Delete
$type = 'text/x-sass';
[4096] Fix | Delete
break;
[4097] Fix | Delete
case 'sh':
[4098] Fix | Delete
case 'bash':
[4099] Fix | Delete
$type = 'text/x-sh';
[4100] Fix | Delete
break;
[4101] Fix | Delete
case 'sql':
[4102] Fix | Delete
$type = 'text/x-sql';
[4103] Fix | Delete
break;
[4104] Fix | Delete
case 'svg':
[4105] Fix | Delete
$type = 'application/svg+xml';
[4106] Fix | Delete
break;
[4107] Fix | Delete
case 'xml':
[4108] Fix | Delete
$type = 'text/xml';
[4109] Fix | Delete
break;
[4110] Fix | Delete
case 'yml':
[4111] Fix | Delete
case 'yaml':
[4112] Fix | Delete
$type = 'text/x-yaml';
[4113] Fix | Delete
break;
[4114] Fix | Delete
case 'txt':
[4115] Fix | Delete
default:
[4116] Fix | Delete
$type = 'text/plain';
[4117] Fix | Delete
break;
[4118] Fix | Delete
}
[4119] Fix | Delete
}
[4120] Fix | Delete
}
[4121] Fix | Delete
[4122] Fix | Delete
if ( in_array( $type, array( 'text/css', 'text/x-scss', 'text/x-less', 'text/x-sass' ), true ) ) {
[4123] Fix | Delete
$settings['codemirror'] = array_merge(
[4124] Fix | Delete
$settings['codemirror'],
[4125] Fix | Delete
array(
[4126] Fix | Delete
'mode' => $type,
[4127] Fix | Delete
'lint' => false,
[4128] Fix | Delete
'autoCloseBrackets' => true,
[4129] Fix | Delete
'matchBrackets' => true,
[4130] Fix | Delete
)
[4131] Fix | Delete
);
[4132] Fix | Delete
} elseif ( 'text/x-diff' === $type ) {
[4133] Fix | Delete
$settings['codemirror'] = array_merge(
[4134] Fix | Delete
$settings['codemirror'],
[4135] Fix | Delete
array(
[4136] Fix | Delete
'mode' => 'diff',
[4137] Fix | Delete
)
[4138] Fix | Delete
);
[4139] Fix | Delete
} elseif ( 'text/html' === $type ) {
[4140] Fix | Delete
$settings['codemirror'] = array_merge(
[4141] Fix | Delete
$settings['codemirror'],
[4142] Fix | Delete
array(
[4143] Fix | Delete
'mode' => 'htmlmixed',
[4144] Fix | Delete
'lint' => true,
[4145] Fix | Delete
'autoCloseBrackets' => true,
[4146] Fix | Delete
'autoCloseTags' => true,
[4147] Fix | Delete
'matchTags' => array(
[4148] Fix | Delete
'bothTags' => true,
[4149] Fix | Delete
),
[4150] Fix | Delete
)
[4151] Fix | Delete
);
[4152] Fix | Delete
[4153] Fix | Delete
if ( ! current_user_can( 'unfiltered_html' ) ) {
[4154] Fix | Delete
$settings['htmlhint']['kses'] = wp_kses_allowed_html( 'post' );
[4155] Fix | Delete
}
[4156] Fix | Delete
} elseif ( 'text/x-gfm' === $type ) {
[4157] Fix | Delete
$settings['codemirror'] = array_merge(
[4158] Fix | Delete
$settings['codemirror'],
[4159] Fix | Delete
array(
[4160] Fix | Delete
'mode' => 'gfm',
[4161] Fix | Delete
'highlightFormatting' => true,
[4162] Fix | Delete
)
[4163] Fix | Delete
);
[4164] Fix | Delete
} elseif ( 'application/javascript' === $type || 'text/javascript' === $type ) {
[4165] Fix | Delete
$settings['codemirror'] = array_merge(
[4166] Fix | Delete
$settings['codemirror'],
[4167] Fix | Delete
array(
[4168] Fix | Delete
'mode' => 'javascript',
[4169] Fix | Delete
'lint' => true,
[4170] Fix | Delete
'autoCloseBrackets' => true,
[4171] Fix | Delete
'matchBrackets' => true,
[4172] Fix | Delete
)
[4173] Fix | Delete
);
[4174] Fix | Delete
} elseif ( str_contains( $type, 'json' ) ) {
[4175] Fix | Delete
$settings['codemirror'] = array_merge(
[4176] Fix | Delete
$settings['codemirror'],
[4177] Fix | Delete
array(
[4178] Fix | Delete
'mode' => array(
[4179] Fix | Delete
'name' => 'javascript',
[4180] Fix | Delete
),
[4181] Fix | Delete
'lint' => true,
[4182] Fix | Delete
'autoCloseBrackets' => true,
[4183] Fix | Delete
'matchBrackets' => true,
[4184] Fix | Delete
)
[4185] Fix | Delete
);
[4186] Fix | Delete
if ( 'application/ld+json' === $type ) {
[4187] Fix | Delete
$settings['codemirror']['mode']['jsonld'] = true;
[4188] Fix | Delete
} else {
[4189] Fix | Delete
$settings['codemirror']['mode']['json'] = true;
[4190] Fix | Delete
}
[4191] Fix | Delete
} elseif ( str_contains( $type, 'jsx' ) ) {
[4192] Fix | Delete
$settings['codemirror'] = array_merge(
[4193] Fix | Delete
$settings['codemirror'],
[4194] Fix | Delete
array(
[4195] Fix | Delete
'mode' => 'jsx',
[4196] Fix | Delete
'autoCloseBrackets' => true,
[4197] Fix | Delete
'matchBrackets' => true,
[4198] Fix | Delete
)
[4199] Fix | Delete
);
[4200] Fix | Delete
} elseif ( 'text/x-markdown' === $type ) {
[4201] Fix | Delete
$settings['codemirror'] = array_merge(
[4202] Fix | Delete
$settings['codemirror'],
[4203] Fix | Delete
array(
[4204] Fix | Delete
'mode' => 'markdown',
[4205] Fix | Delete
'highlightFormatting' => true,
[4206] Fix | Delete
)
[4207] Fix | Delete
);
[4208] Fix | Delete
} elseif ( 'text/nginx' === $type ) {
[4209] Fix | Delete
$settings['codemirror'] = array_merge(
[4210] Fix | Delete
$settings['codemirror'],
[4211] Fix | Delete
array(
[4212] Fix | Delete
'mode' => 'nginx',
[4213] Fix | Delete
)
[4214] Fix | Delete
);
[4215] Fix | Delete
} elseif ( 'application/x-httpd-php' === $type ) {
[4216] Fix | Delete
$settings['codemirror'] = array_merge(
[4217] Fix | Delete
$settings['codemirror'],
[4218] Fix | Delete
array(
[4219] Fix | Delete
'mode' => 'php',
[4220] Fix | Delete
'autoCloseBrackets' => true,
[4221] Fix | Delete
'autoCloseTags' => true,
[4222] Fix | Delete
'matchBrackets' => true,
[4223] Fix | Delete
'matchTags' => array(
[4224] Fix | Delete
'bothTags' => true,
[4225] Fix | Delete
),
[4226] Fix | Delete
)
[4227] Fix | Delete
);
[4228] Fix | Delete
} elseif ( 'text/x-sql' === $type || 'text/x-mysql' === $type ) {
[4229] Fix | Delete
$settings['codemirror'] = array_merge(
[4230] Fix | Delete
$settings['codemirror'],
[4231] Fix | Delete
array(
[4232] Fix | Delete
'mode' => 'sql',
[4233] Fix | Delete
'autoCloseBrackets' => true,
[4234] Fix | Delete
'matchBrackets' => true,
[4235] Fix | Delete
)
[4236] Fix | Delete
);
[4237] Fix | Delete
} elseif ( str_contains( $type, 'xml' ) ) {
[4238] Fix | Delete
$settings['codemirror'] = array_merge(
[4239] Fix | Delete
$settings['codemirror'],
[4240] Fix | Delete
array(
[4241] Fix | Delete
'mode' => 'xml',
[4242] Fix | Delete
'autoCloseBrackets' => true,
[4243] Fix | Delete
'autoCloseTags' => true,
[4244] Fix | Delete
'matchTags' => array(
[4245] Fix | Delete
'bothTags' => true,
[4246] Fix | Delete
),
[4247] Fix | Delete
)
[4248] Fix | Delete
);
[4249] Fix | Delete
} elseif ( 'text/x-yaml' === $type ) {
[4250] Fix | Delete
$settings['codemirror'] = array_merge(
[4251] Fix | Delete
$settings['codemirror'],
[4252] Fix | Delete
array(
[4253] Fix | Delete
'mode' => 'yaml',
[4254] Fix | Delete
)
[4255] Fix | Delete
);
[4256] Fix | Delete
} else {
[4257] Fix | Delete
$settings['codemirror']['mode'] = $type;
[4258] Fix | Delete
}
[4259] Fix | Delete
[4260] Fix | Delete
if ( ! empty( $settings['codemirror']['lint'] ) ) {
[4261] Fix | Delete
$settings['codemirror']['gutters'][] = 'CodeMirror-lint-markers';
[4262] Fix | Delete
}
[4263] Fix | Delete
[4264] Fix | Delete
// Let settings supplied via args override any defaults.
[4265] Fix | Delete
foreach ( wp_array_slice_assoc( $args, array( 'codemirror', 'csslint', 'jshint', 'htmlhint' ) ) as $key => $value ) {
[4266] Fix | Delete
$settings[ $key ] = array_merge(
[4267] Fix | Delete
$settings[ $key ],
[4268] Fix | Delete
$value
[4269] Fix | Delete
);
[4270] Fix | Delete
}
[4271] Fix | Delete
[4272] Fix | Delete
/**
[4273] Fix | Delete
* Filters settings that are passed into the code editor.
[4274] Fix | Delete
*
[4275] Fix | Delete
* Returning a falsey value will disable the syntax-highlighting code editor.
[4276] Fix | Delete
*
[4277] Fix | Delete
* @since 4.9.0
[4278] Fix | Delete
*
[4279] Fix | Delete
* @param array $settings The array of settings passed to the code editor.
[4280] Fix | Delete
* A falsey value disables the editor.
[4281] Fix | Delete
* @param array $args {
[4282] Fix | Delete
* Args passed when calling `get_code_editor_settings()`.
[4283] Fix | Delete
*
[4284] Fix | Delete
* @type string $type The MIME type of the file to be edited.
[4285] Fix | Delete
* @type string $file Filename being edited.
[4286] Fix | Delete
* @type WP_Theme $theme Theme being edited when on the theme file editor.
[4287] Fix | Delete
* @type string $plugin Plugin being edited when on the plugin file editor.
[4288] Fix | Delete
* @type array $codemirror Additional CodeMirror setting overrides.
[4289] Fix | Delete
* @type array $csslint CSSLint rule overrides.
[4290] Fix | Delete
* @type array $jshint JSHint rule overrides.
[4291] Fix | Delete
* @type array $htmlhint HTMLHint rule overrides.
[4292] Fix | Delete
* }
[4293] Fix | Delete
*/
[4294] Fix | Delete
return apply_filters( 'wp_code_editor_settings', $settings, $args );
[4295] Fix | Delete
}
[4296] Fix | Delete
[4297] Fix | Delete
/**
[4298] Fix | Delete
* Retrieves the contents of the search WordPress query variable.
[4299] Fix | Delete
*
[4300] Fix | Delete
* The search query string is passed through esc_attr() to ensure that it is safe
[4301] Fix | Delete
* for placing in an HTML attribute.
[4302] Fix | Delete
*
[4303] Fix | Delete
* @since 2.3.0
[4304] Fix | Delete
*
[4305] Fix | Delete
* @param bool $escaped Whether the result is escaped. Default true.
[4306] Fix | Delete
* Only use when you are later escaping it. Do not use unescaped.
[4307] Fix | Delete
* @return string
[4308] Fix | Delete
*/
[4309] Fix | Delete
function get_search_query( $escaped = true ) {
[4310] Fix | Delete
/**
[4311] Fix | Delete
* Filters the contents of the search query variable.
[4312] Fix | Delete
*
[4313] Fix | Delete
* @since 2.3.0
[4314] Fix | Delete
*
[4315] Fix | Delete
* @param mixed $search Contents of the search query variable.
[4316] Fix | Delete
*/
[4317] Fix | Delete
$query = apply_filters( 'get_search_query', get_query_var( 's' ) );
[4318] Fix | Delete
[4319] Fix | Delete
if ( $escaped ) {
[4320] Fix | Delete
$query = esc_attr( $query );
[4321] Fix | Delete
}
[4322] Fix | Delete
return $query;
[4323] Fix | Delete
}
[4324] Fix | Delete
[4325] Fix | Delete
/**
[4326] Fix | Delete
* Displays the contents of the search query variable.
[4327] Fix | Delete
*
[4328] Fix | Delete
* The search query string is passed through esc_attr() to ensure that it is safe
[4329] Fix | Delete
* for placing in an HTML attribute.
[4330] Fix | Delete
*
[4331] Fix | Delete
* @since 2.1.0
[4332] Fix | Delete
*/
[4333] Fix | Delete
function the_search_query() {
[4334] Fix | Delete
/**
[4335] Fix | Delete
* Filters the contents of the search query variable for display.
[4336] Fix | Delete
*
[4337] Fix | Delete
* @since 2.3.0
[4338] Fix | Delete
*
[4339] Fix | Delete
* @param mixed $search Contents of the search query variable.
[4340] Fix | Delete
*/
[4341] Fix | Delete
echo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) );
[4342] Fix | Delete
}
[4343] Fix | Delete
[4344] Fix | Delete
/**
[4345] Fix | Delete
* Gets the language attributes for the 'html' tag.
[4346] Fix | Delete
*
[4347] Fix | Delete
* Builds up a set of HTML attributes containing the text direction and language
[4348] Fix | Delete
* information for the page.
[4349] Fix | Delete
*
[4350] Fix | Delete
* @since 4.3.0
[4351] Fix | Delete
*
[4352] Fix | Delete
* @param string $doctype Optional. The type of HTML document. Accepts 'xhtml' or 'html'. Default 'html'.
[4353] Fix | Delete
* @return string A space-separated list of language attributes.
[4354] Fix | Delete
*/
[4355] Fix | Delete
function get_language_attributes( $doctype = 'html' ) {
[4356] Fix | Delete
$attributes = array();
[4357] Fix | Delete
[4358] Fix | Delete
if ( function_exists( 'is_rtl' ) && is_rtl() ) {
[4359] Fix | Delete
$attributes[] = 'dir="rtl"';
[4360] Fix | Delete
}
[4361] Fix | Delete
[4362] Fix | Delete
$lang = get_bloginfo( 'language' );
[4363] Fix | Delete
if ( $lang ) {
[4364] Fix | Delete
if ( 'text/html' === get_option( 'html_type' ) || 'html' === $doctype ) {
[4365] Fix | Delete
$attributes[] = 'lang="' . esc_attr( $lang ) . '"';
[4366] Fix | Delete
}
[4367] Fix | Delete
[4368] Fix | Delete
if ( 'text/html' !== get_option( 'html_type' ) || 'xhtml' === $doctype ) {
[4369] Fix | Delete
$attributes[] = 'xml:lang="' . esc_attr( $lang ) . '"';
[4370] Fix | Delete
}
[4371] Fix | Delete
}
[4372] Fix | Delete
[4373] Fix | Delete
$output = implode( ' ', $attributes );
[4374] Fix | Delete
[4375] Fix | Delete
/**
[4376] Fix | Delete
* Filters the language attributes for display in the 'html' tag.
[4377] Fix | Delete
*
[4378] Fix | Delete
* @since 2.5.0
[4379] Fix | Delete
* @since 4.3.0 Added the `$doctype` parameter.
[4380] Fix | Delete
*
[4381] Fix | Delete
* @param string $output A space-separated list of language attributes.
[4382] Fix | Delete
* @param string $doctype The type of HTML document (xhtml|html).
[4383] Fix | Delete
*/
[4384] Fix | Delete
return apply_filters( 'language_attributes', $output, $doctype );
[4385] Fix | Delete
}
[4386] Fix | Delete
[4387] Fix | Delete
/**
[4388] Fix | Delete
* Displays the language attributes for the 'html' tag.
[4389] Fix | Delete
*
[4390] Fix | Delete
* Builds up a set of HTML attributes containing the text direction and language
[4391] Fix | Delete
* information for the page.
[4392] Fix | Delete
*
[4393] Fix | Delete
* @since 2.1.0
[4394] Fix | Delete
* @since 4.3.0 Converted into a wrapper for get_language_attributes().
[4395] Fix | Delete
*
[4396] Fix | Delete
* @param string $doctype Optional. The type of HTML document. Accepts 'xhtml' or 'html'. Default 'html'.
[4397] Fix | Delete
*/
[4398] Fix | Delete
function language_attributes( $doctype = 'html' ) {
[4399] Fix | Delete
echo get_language_attributes( $doctype );
[4400] Fix | Delete
}
[4401] Fix | Delete
[4402] Fix | Delete
/**
[4403] Fix | Delete
* Retrieves paginated links for archive post pages.
[4404] Fix | Delete
*
[4405] Fix | Delete
* Technically, the function can be used to create paginated link list for any
[4406] Fix | Delete
* area. The 'base' argument is used to reference the url, which will be used to
[4407] Fix | Delete
* create the paginated links. The 'format' argument is then used for replacing
[4408] Fix | Delete
* the page number. It is however, most likely and by default, to be used on the
[4409] Fix | Delete
* archive post pages.
[4410] Fix | Delete
*
[4411] Fix | Delete
* The 'type' argument controls format of the returned value. The default is
[4412] Fix | Delete
* 'plain', which is just a string with the links separated by a newline
[4413] Fix | Delete
* character. The other possible values are either 'array' or 'list'. The
[4414] Fix | Delete
* 'array' value will return an array of the paginated link list to offer full
[4415] Fix | Delete
* control of display. The 'list' value will place all of the paginated links in
[4416] Fix | Delete
* an unordered HTML list.
[4417] Fix | Delete
*
[4418] Fix | Delete
* The 'total' argument is the total amount of pages and is an integer. The
[4419] Fix | Delete
* 'current' argument is the current page number and is also an integer.
[4420] Fix | Delete
*
[4421] Fix | Delete
* An example of the 'base' argument is "http://example.com/all_posts.php%_%"
[4422] Fix | Delete
* and the '%_%' is required. The '%_%' will be replaced by the contents of in
[4423] Fix | Delete
* the 'format' argument. An example for the 'format' argument is "?page=%#%"
[4424] Fix | Delete
* and the '%#%' is also required. The '%#%' will be replaced with the page
[4425] Fix | Delete
* number.
[4426] Fix | Delete
*
[4427] Fix | Delete
* You can include the previous and next links in the list by setting the
[4428] Fix | Delete
* 'prev_next' argument to true, which it is by default. You can set the
[4429] Fix | Delete
* previous text, by using the 'prev_text' argument. You can set the next text
[4430] Fix | Delete
* by setting the 'next_text' argument.
[4431] Fix | Delete
*
[4432] Fix | Delete
* If the 'show_all' argument is set to true, then it will show all of the pages
[4433] Fix | Delete
* instead of a short list of the pages near the current page. By default, the
[4434] Fix | Delete
* 'show_all' is set to false and controlled by the 'end_size' and 'mid_size'
[4435] Fix | Delete
* arguments. The 'end_size' argument is how many numbers on either the start
[4436] Fix | Delete
* and the end list edges, by default is 1. The 'mid_size' argument is how many
[4437] Fix | Delete
* numbers to either side of current page, but not including current page.
[4438] Fix | Delete
*
[4439] Fix | Delete
* It is possible to add query vars to the link by using the 'add_args' argument
[4440] Fix | Delete
* and see add_query_arg() for more information.
[4441] Fix | Delete
*
[4442] Fix | Delete
* The 'before_page_number' and 'after_page_number' arguments allow users to
[4443] Fix | Delete
* augment the links themselves. Typically this might be to add context to the
[4444] Fix | Delete
* numbered links so that screen reader users understand what the links are for.
[4445] Fix | Delete
* The text strings are added before and after the page number - within the
[4446] Fix | Delete
* anchor tag.
[4447] Fix | Delete
*
[4448] Fix | Delete
* @since 2.1.0
[4449] Fix | Delete
* @since 4.9.0 Added the `aria_current` argument.
[4450] Fix | Delete
*
[4451] Fix | Delete
* @global WP_Query $wp_query WordPress Query object.
[4452] Fix | Delete
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
[4453] Fix | Delete
*
[4454] Fix | Delete
* @param string|array $args {
[4455] Fix | Delete
* Optional. Array or string of arguments for generating paginated links for archives.
[4456] Fix | Delete
*
[4457] Fix | Delete
* @type string $base Base of the paginated url. Default empty.
[4458] Fix | Delete
* @type string $format Format for the pagination structure. Default empty.
[4459] Fix | Delete
* @type int $total The total amount of pages. Default is the value WP_Query's
[4460] Fix | Delete
* `max_num_pages` or 1.
[4461] Fix | Delete
* @type int $current The current page number. Default is 'paged' query var or 1.
[4462] Fix | Delete
* @type string $aria_current The value for the aria-current attribute. Possible values are 'page',
[4463] Fix | Delete
* 'step', 'location', 'date', 'time', 'true', 'false'. Default is 'page'.
[4464] Fix | Delete
* @type bool $show_all Whether to show all pages. Default false.
[4465] Fix | Delete
* @type int $end_size How many numbers on either the start and the end list edges.
[4466] Fix | Delete
* Default 1.
[4467] Fix | Delete
* @type int $mid_size How many numbers to either side of the current pages. Default 2.
[4468] Fix | Delete
* @type bool $prev_next Whether to include the previous and next links in the list. Default true.
[4469] Fix | Delete
* @type string $prev_text The previous page text. Default '« Previous'.
[4470] Fix | Delete
* @type string $next_text The next page text. Default 'Next »'.
[4471] Fix | Delete
* @type string $type Controls format of the returned value. Possible values are 'plain',
[4472] Fix | Delete
* 'array' and 'list'. Default is 'plain'.
[4473] Fix | Delete
* @type array $add_args An array of query args to add. Default false.
[4474] Fix | Delete
* @type string $add_fragment A string to append to each link. Default empty.
[4475] Fix | Delete
* @type string $before_page_number A string to appear before the page number. Default empty.
[4476] Fix | Delete
* @type string $after_page_number A string to append after the page number. Default empty.
[4477] Fix | Delete
* }
[4478] Fix | Delete
* @return string|string[]|void String of page links or array of page links, depending on 'type' argument.
[4479] Fix | Delete
* Void if total number of pages is less than 2.
[4480] Fix | Delete
*/
[4481] Fix | Delete
function paginate_links( $args = '' ) {
[4482] Fix | Delete
global $wp_query, $wp_rewrite;
[4483] Fix | Delete
[4484] Fix | Delete
// Setting up default values based on the current URL.
[4485] Fix | Delete
$pagenum_link = html_entity_decode( get_pagenum_link() );
[4486] Fix | Delete
$url_parts = explode( '?', $pagenum_link );
[4487] Fix | Delete
[4488] Fix | Delete
// Get max pages and current page out of the current query, if available.
[4489] Fix | Delete
$total = isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1;
[4490] Fix | Delete
$current = get_query_var( 'paged' ) ? (int) get_query_var( 'paged' ) : 1;
[4491] Fix | Delete
[4492] Fix | Delete
// Append the format placeholder to the base URL.
[4493] Fix | Delete
$pagenum_link = trailingslashit( $url_parts[0] ) . '%_%';
[4494] Fix | Delete
[4495] Fix | Delete
// URL base depends on permalink settings.
[4496] Fix | Delete
$format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';
[4497] Fix | Delete
$format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%';
[4498] Fix | Delete
[4499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function