PluginProbe ʕ •ᴥ•ʔ
پارسی دیت – Parsi Date / 2.3.1
پارسی دیت – Parsi Date v2.3.1
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 9 years ago plugins 9 years ago widget 9 years ago fixes-archive.php 9 years ago fixes-archives.php 9 years ago fixes-calendar.php 9 years ago fixes-dates.php 9 years ago fixes-misc.php 9 years ago fixes-permalinks.php 9 years ago general.php 9 years ago install.php 9 years ago parsidate.php 9 years ago settings.php 9 years ago
fixes-archive.php
45 lines
1 <?php
2 /**
3 * Fixes archives and make them compatible with Shamsi date
4 *
5 * @package WP-Parsidate
6 * @subpackage Fixes/Archives
7 * @author Mobin Ghasempoor
8 */
9
10 add_filter( 'wp_title', 'wpp_fix_title', 10000, 2 );
11 add_filter( 'pre_get_document_title', 'wpp_fix_title', 10000 ); // WP 4.4+
12
13 /**
14 * Fixes titles for archives
15 *
16 * @param string $title Archive title
17 * @param string $sep Separator
18 * @param string $sep_location Separator location
19 *
20 * @return string New archive title
21 */
22 function wpp_fix_title( $title, $sep = '-', $sep_location = 'right' ) {
23 global $persian_month_names, $wp_query, $wpp_settings;
24 $query = $wp_query->query;
25
26 if ( ! is_archive() || $wpp_settings['persian_date'] == 'disable' ) {
27 return $title;
28 }
29
30 if ( $sep_location == 'right' ) {
31 $query = array_reverse( $query );
32 }
33
34 if ( isset( $query['monthnum'] ) ) {
35 $query['monthnum'] = $persian_month_names[ intval( $query['monthnum'] ) ];
36 $title = implode( " ", $query ) . " $sep " . get_bloginfo( "name" );
37 }
38
39 if ( $wpp_settings['conv_page_title'] != 'disable' ) {
40 $title = fixnumber( $title );
41 }
42
43 return $title;
44 }
45