PluginProbe ʕ •ᴥ•ʔ
پارسی دیت – Parsi Date / 4.0.0
پارسی دیت – Parsi Date v4.0.0
6.1 5.1.6 5.1.7 5.1.8 5.1.8.2 6.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.0.0-alpha 2.1 2.1.1 2.1.2 2.1.3 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0.1 2.3.0.2 2.3.1 2.3.2 2.3.3 2.3.4 3.0.1 3.0.2 3.0.3 4.0.0 4.0.1 4.0.2 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5
wp-parsidate / includes / fixes-archive.php
wp-parsidate / includes Last commit date
admin 4 years ago plugins 4 years ago widget 4 years ago fixes-archive.php 4 years ago fixes-archives.php 4 years ago fixes-calendar.php 4 years ago fixes-dates.php 4 years ago fixes-misc.php 4 years ago fixes-permalinks.php 4 years ago general.php 4 years ago install.php 4 years ago parsidate.php 4 years ago settings.php 4 years ago
fixes-archive.php
49 lines
1 <?php
2
3 defined( 'ABSPATH' ) or exit( 'No direct script access allowed' );
4
5 /**
6 * Fixes archives and make them compatible with Shamsi date
7 *
8 * @package WP-Parsidate
9 * @subpackage Fixes/Archives
10 * @author Mobin Ghasempoor
11 */
12
13
14 /**
15 * Fixes titles for archives
16 *
17 * @param string $title Archive title
18 * @param string $sep Separator
19 * @param string $sep_location Separator location
20 *
21 * @return string New archive title
22 */
23 function wpp_fix_title( $title, $sep = '-', $sep_location = 'right' ) {
24 global $persian_month_names, $wp_query, $wpp_settings;
25
26 $query = $wp_query->query;
27
28 if ( ! is_archive() || ! wpp_is_active( 'persian_date' ) ) {
29 return $title;
30 }
31
32 if ( $sep_location == 'right' ) {
33 $query = array_reverse( $query );
34 }
35
36 if ( isset( $query['monthnum'] ) ) {
37 $query['monthnum'] = $persian_month_names[ intval( $query['monthnum'] ) ];
38 $title = implode( " ", $query ) . " $sep " . get_bloginfo( "name" );
39 }
40
41 if ( wpp_is_active( 'conv_page_title' ) ) {
42 $title = fix_number( $title );
43 }
44
45 return $title;
46 }
47
48 add_filter( 'wp_title', 'wpp_fix_title', PHP_INT_MAX, 2 );
49 add_filter( 'pre_get_document_title', 'wpp_fix_title', PHP_INT_MAX ); // WP 4.4+