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
$allowed .= ' ' . $attribute . '=""';
[2500] Fix | Delete
}
[2501] Fix | Delete
}
[2502] Fix | Delete
$allowed .= '> ';
[2503] Fix | Delete
}
[2504] Fix | Delete
return htmlentities( $allowed );
[2505] Fix | Delete
}
[2506] Fix | Delete
[2507] Fix | Delete
/***** Date/Time tags */
[2508] Fix | Delete
[2509] Fix | Delete
/**
[2510] Fix | Delete
* Outputs the date in iso8601 format for xml files.
[2511] Fix | Delete
*
[2512] Fix | Delete
* @since 1.0.0
[2513] Fix | Delete
*/
[2514] Fix | Delete
function the_date_xml() {
[2515] Fix | Delete
echo mysql2date( 'Y-m-d', get_post()->post_date, false );
[2516] Fix | Delete
}
[2517] Fix | Delete
[2518] Fix | Delete
/**
[2519] Fix | Delete
* Displays or retrieves the date the current post was written (once per date)
[2520] Fix | Delete
*
[2521] Fix | Delete
* Will only output the date if the current post's date is different from the
[2522] Fix | Delete
* previous one output.
[2523] Fix | Delete
*
[2524] Fix | Delete
* i.e. Only one date listing will show per day worth of posts shown in the loop, even if the
[2525] Fix | Delete
* function is called several times for each post.
[2526] Fix | Delete
*
[2527] Fix | Delete
* HTML output can be filtered with 'the_date'.
[2528] Fix | Delete
* Date string output can be filtered with 'get_the_date'.
[2529] Fix | Delete
*
[2530] Fix | Delete
* @since 0.71
[2531] Fix | Delete
*
[2532] Fix | Delete
* @global string $currentday The day of the current post in the loop.
[2533] Fix | Delete
* @global string $previousday The day of the previous post in the loop.
[2534] Fix | Delete
*
[2535] Fix | Delete
* @param string $format Optional. PHP date format. Defaults to the 'date_format' option.
[2536] Fix | Delete
* @param string $before Optional. Output before the date. Default empty.
[2537] Fix | Delete
* @param string $after Optional. Output after the date. Default empty.
[2538] Fix | Delete
* @param bool $display Optional. Whether to echo the date or return it. Default true.
[2539] Fix | Delete
* @return string|void String if retrieving.
[2540] Fix | Delete
*/
[2541] Fix | Delete
function the_date( $format = '', $before = '', $after = '', $display = true ) {
[2542] Fix | Delete
global $currentday, $previousday;
[2543] Fix | Delete
[2544] Fix | Delete
$the_date = '';
[2545] Fix | Delete
[2546] Fix | Delete
if ( is_new_day() ) {
[2547] Fix | Delete
$the_date = $before . get_the_date( $format ) . $after;
[2548] Fix | Delete
$previousday = $currentday;
[2549] Fix | Delete
}
[2550] Fix | Delete
[2551] Fix | Delete
/**
[2552] Fix | Delete
* Filters the date a post was published for display.
[2553] Fix | Delete
*
[2554] Fix | Delete
* @since 0.71
[2555] Fix | Delete
*
[2556] Fix | Delete
* @param string $the_date The formatted date string.
[2557] Fix | Delete
* @param string $format PHP date format.
[2558] Fix | Delete
* @param string $before HTML output before the date.
[2559] Fix | Delete
* @param string $after HTML output after the date.
[2560] Fix | Delete
*/
[2561] Fix | Delete
$the_date = apply_filters( 'the_date', $the_date, $format, $before, $after );
[2562] Fix | Delete
[2563] Fix | Delete
if ( $display ) {
[2564] Fix | Delete
echo $the_date;
[2565] Fix | Delete
} else {
[2566] Fix | Delete
return $the_date;
[2567] Fix | Delete
}
[2568] Fix | Delete
}
[2569] Fix | Delete
[2570] Fix | Delete
/**
[2571] Fix | Delete
* Retrieves the date on which the post was written.
[2572] Fix | Delete
*
[2573] Fix | Delete
* Unlike the_date() this function will always return the date.
[2574] Fix | Delete
* Modify output with the {@see 'get_the_date'} filter.
[2575] Fix | Delete
*
[2576] Fix | Delete
* @since 3.0.0
[2577] Fix | Delete
*
[2578] Fix | Delete
* @param string $format Optional. PHP date format. Defaults to the 'date_format' option.
[2579] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post.
[2580] Fix | Delete
* @return string|int|false Date the current post was written. False on failure.
[2581] Fix | Delete
*/
[2582] Fix | Delete
function get_the_date( $format = '', $post = null ) {
[2583] Fix | Delete
$post = get_post( $post );
[2584] Fix | Delete
[2585] Fix | Delete
if ( ! $post ) {
[2586] Fix | Delete
return false;
[2587] Fix | Delete
}
[2588] Fix | Delete
[2589] Fix | Delete
$_format = ! empty( $format ) ? $format : get_option( 'date_format' );
[2590] Fix | Delete
[2591] Fix | Delete
$the_date = get_post_time( $_format, false, $post, true );
[2592] Fix | Delete
[2593] Fix | Delete
/**
[2594] Fix | Delete
* Filters the date a post was published.
[2595] Fix | Delete
*
[2596] Fix | Delete
* @since 3.0.0
[2597] Fix | Delete
*
[2598] Fix | Delete
* @param string|int $the_date Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
[2599] Fix | Delete
* @param string $format PHP date format.
[2600] Fix | Delete
* @param WP_Post $post The post object.
[2601] Fix | Delete
*/
[2602] Fix | Delete
return apply_filters( 'get_the_date', $the_date, $format, $post );
[2603] Fix | Delete
}
[2604] Fix | Delete
[2605] Fix | Delete
/**
[2606] Fix | Delete
* Displays the date on which the post was last modified.
[2607] Fix | Delete
*
[2608] Fix | Delete
* @since 2.1.0
[2609] Fix | Delete
*
[2610] Fix | Delete
* @param string $format Optional. PHP date format. Defaults to the 'date_format' option.
[2611] Fix | Delete
* @param string $before Optional. Output before the date. Default empty.
[2612] Fix | Delete
* @param string $after Optional. Output after the date. Default empty.
[2613] Fix | Delete
* @param bool $display Optional. Whether to echo the date or return it. Default true.
[2614] Fix | Delete
* @return string|void String if retrieving.
[2615] Fix | Delete
*/
[2616] Fix | Delete
function the_modified_date( $format = '', $before = '', $after = '', $display = true ) {
[2617] Fix | Delete
$the_modified_date = $before . get_the_modified_date( $format ) . $after;
[2618] Fix | Delete
[2619] Fix | Delete
/**
[2620] Fix | Delete
* Filters the date a post was last modified for display.
[2621] Fix | Delete
*
[2622] Fix | Delete
* @since 2.1.0
[2623] Fix | Delete
*
[2624] Fix | Delete
* @param string|false $the_modified_date The last modified date or false if no post is found.
[2625] Fix | Delete
* @param string $format PHP date format.
[2626] Fix | Delete
* @param string $before HTML output before the date.
[2627] Fix | Delete
* @param string $after HTML output after the date.
[2628] Fix | Delete
*/
[2629] Fix | Delete
$the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $format, $before, $after );
[2630] Fix | Delete
[2631] Fix | Delete
if ( $display ) {
[2632] Fix | Delete
echo $the_modified_date;
[2633] Fix | Delete
} else {
[2634] Fix | Delete
return $the_modified_date;
[2635] Fix | Delete
}
[2636] Fix | Delete
}
[2637] Fix | Delete
[2638] Fix | Delete
/**
[2639] Fix | Delete
* Retrieves the date on which the post was last modified.
[2640] Fix | Delete
*
[2641] Fix | Delete
* @since 2.1.0
[2642] Fix | Delete
* @since 4.6.0 Added the `$post` parameter.
[2643] Fix | Delete
*
[2644] Fix | Delete
* @param string $format Optional. PHP date format. Defaults to the 'date_format' option.
[2645] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post.
[2646] Fix | Delete
* @return string|int|false Date the current post was modified. False on failure.
[2647] Fix | Delete
*/
[2648] Fix | Delete
function get_the_modified_date( $format = '', $post = null ) {
[2649] Fix | Delete
$post = get_post( $post );
[2650] Fix | Delete
[2651] Fix | Delete
if ( ! $post ) {
[2652] Fix | Delete
// For backward compatibility, failures go through the filter below.
[2653] Fix | Delete
$the_time = false;
[2654] Fix | Delete
} else {
[2655] Fix | Delete
$_format = ! empty( $format ) ? $format : get_option( 'date_format' );
[2656] Fix | Delete
[2657] Fix | Delete
$the_time = get_post_modified_time( $_format, false, $post, true );
[2658] Fix | Delete
}
[2659] Fix | Delete
[2660] Fix | Delete
/**
[2661] Fix | Delete
* Filters the date a post was last modified.
[2662] Fix | Delete
*
[2663] Fix | Delete
* @since 2.1.0
[2664] Fix | Delete
* @since 4.6.0 Added the `$post` parameter.
[2665] Fix | Delete
*
[2666] Fix | Delete
* @param string|int|false $the_time The formatted date or false if no post is found.
[2667] Fix | Delete
* @param string $format PHP date format.
[2668] Fix | Delete
* @param WP_Post|null $post WP_Post object or null if no post is found.
[2669] Fix | Delete
*/
[2670] Fix | Delete
return apply_filters( 'get_the_modified_date', $the_time, $format, $post );
[2671] Fix | Delete
}
[2672] Fix | Delete
[2673] Fix | Delete
/**
[2674] Fix | Delete
* Displays the time at which the post was written.
[2675] Fix | Delete
*
[2676] Fix | Delete
* @since 0.71
[2677] Fix | Delete
*
[2678] Fix | Delete
* @param string $format Optional. Format to use for retrieving the time the post
[2679] Fix | Delete
* was written. Accepts 'G', 'U', or PHP date format.
[2680] Fix | Delete
* Defaults to the 'time_format' option.
[2681] Fix | Delete
*/
[2682] Fix | Delete
function the_time( $format = '' ) {
[2683] Fix | Delete
/**
[2684] Fix | Delete
* Filters the time a post was written for display.
[2685] Fix | Delete
*
[2686] Fix | Delete
* @since 0.71
[2687] Fix | Delete
*
[2688] Fix | Delete
* @param string $get_the_time The formatted time.
[2689] Fix | Delete
* @param string $format Format to use for retrieving the time the post
[2690] Fix | Delete
* was written. Accepts 'G', 'U', or PHP date format.
[2691] Fix | Delete
*/
[2692] Fix | Delete
echo apply_filters( 'the_time', get_the_time( $format ), $format );
[2693] Fix | Delete
}
[2694] Fix | Delete
[2695] Fix | Delete
/**
[2696] Fix | Delete
* Retrieves the time at which the post was written.
[2697] Fix | Delete
*
[2698] Fix | Delete
* @since 1.5.0
[2699] Fix | Delete
*
[2700] Fix | Delete
* @param string $format Optional. Format to use for retrieving the time the post
[2701] Fix | Delete
* was written. Accepts 'G', 'U', or PHP date format.
[2702] Fix | Delete
* Defaults to the 'time_format' option.
[2703] Fix | Delete
* @param int|WP_Post $post Post ID or post object. Default is global `$post` object.
[2704] Fix | Delete
* @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
[2705] Fix | Delete
* False on failure.
[2706] Fix | Delete
*/
[2707] Fix | Delete
function get_the_time( $format = '', $post = null ) {
[2708] Fix | Delete
$post = get_post( $post );
[2709] Fix | Delete
[2710] Fix | Delete
if ( ! $post ) {
[2711] Fix | Delete
return false;
[2712] Fix | Delete
}
[2713] Fix | Delete
[2714] Fix | Delete
$_format = ! empty( $format ) ? $format : get_option( 'time_format' );
[2715] Fix | Delete
[2716] Fix | Delete
$the_time = get_post_time( $_format, false, $post, true );
[2717] Fix | Delete
[2718] Fix | Delete
/**
[2719] Fix | Delete
* Filters the time a post was written.
[2720] Fix | Delete
*
[2721] Fix | Delete
* @since 1.5.0
[2722] Fix | Delete
*
[2723] Fix | Delete
* @param string|int $the_time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
[2724] Fix | Delete
* @param string $format Format to use for retrieving the time the post
[2725] Fix | Delete
* was written. Accepts 'G', 'U', or PHP date format.
[2726] Fix | Delete
* @param WP_Post $post Post object.
[2727] Fix | Delete
*/
[2728] Fix | Delete
return apply_filters( 'get_the_time', $the_time, $format, $post );
[2729] Fix | Delete
}
[2730] Fix | Delete
[2731] Fix | Delete
/**
[2732] Fix | Delete
* Retrieves the time at which the post was written.
[2733] Fix | Delete
*
[2734] Fix | Delete
* @since 2.0.0
[2735] Fix | Delete
*
[2736] Fix | Delete
* @param string $format Optional. Format to use for retrieving the time the post
[2737] Fix | Delete
* was written. Accepts 'G', 'U', or PHP date format. Default 'U'.
[2738] Fix | Delete
* @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
[2739] Fix | Delete
* @param int|WP_Post $post Post ID or post object. Default is global `$post` object.
[2740] Fix | Delete
* @param bool $translate Whether to translate the time string. Default false.
[2741] Fix | Delete
* @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
[2742] Fix | Delete
* False on failure.
[2743] Fix | Delete
*/
[2744] Fix | Delete
function get_post_time( $format = 'U', $gmt = false, $post = null, $translate = false ) {
[2745] Fix | Delete
$post = get_post( $post );
[2746] Fix | Delete
[2747] Fix | Delete
if ( ! $post ) {
[2748] Fix | Delete
return false;
[2749] Fix | Delete
}
[2750] Fix | Delete
[2751] Fix | Delete
$source = ( $gmt ) ? 'gmt' : 'local';
[2752] Fix | Delete
$datetime = get_post_datetime( $post, 'date', $source );
[2753] Fix | Delete
[2754] Fix | Delete
if ( false === $datetime ) {
[2755] Fix | Delete
return false;
[2756] Fix | Delete
}
[2757] Fix | Delete
[2758] Fix | Delete
if ( 'U' === $format || 'G' === $format ) {
[2759] Fix | Delete
$time = $datetime->getTimestamp();
[2760] Fix | Delete
[2761] Fix | Delete
// Returns a sum of timestamp with timezone offset. Ideally should never be used.
[2762] Fix | Delete
if ( ! $gmt ) {
[2763] Fix | Delete
$time += $datetime->getOffset();
[2764] Fix | Delete
}
[2765] Fix | Delete
} elseif ( $translate ) {
[2766] Fix | Delete
$time = wp_date( $format, $datetime->getTimestamp(), $gmt ? new DateTimeZone( 'UTC' ) : null );
[2767] Fix | Delete
} else {
[2768] Fix | Delete
if ( $gmt ) {
[2769] Fix | Delete
$datetime = $datetime->setTimezone( new DateTimeZone( 'UTC' ) );
[2770] Fix | Delete
}
[2771] Fix | Delete
[2772] Fix | Delete
$time = $datetime->format( $format );
[2773] Fix | Delete
}
[2774] Fix | Delete
[2775] Fix | Delete
/**
[2776] Fix | Delete
* Filters the localized time a post was written.
[2777] Fix | Delete
*
[2778] Fix | Delete
* @since 2.6.0
[2779] Fix | Delete
*
[2780] Fix | Delete
* @param string|int $time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
[2781] Fix | Delete
* @param string $format Format to use for retrieving the time the post was written.
[2782] Fix | Delete
* Accepts 'G', 'U', or PHP date format.
[2783] Fix | Delete
* @param bool $gmt Whether to retrieve the GMT time.
[2784] Fix | Delete
*/
[2785] Fix | Delete
return apply_filters( 'get_post_time', $time, $format, $gmt );
[2786] Fix | Delete
}
[2787] Fix | Delete
[2788] Fix | Delete
/**
[2789] Fix | Delete
* Retrieves post published or modified time as a `DateTimeImmutable` object instance.
[2790] Fix | Delete
*
[2791] Fix | Delete
* The object will be set to the timezone from WordPress settings.
[2792] Fix | Delete
*
[2793] Fix | Delete
* For legacy reasons, this function allows to choose to instantiate from local or UTC time in database.
[2794] Fix | Delete
* Normally this should make no difference to the result. However, the values might get out of sync in database,
[2795] Fix | Delete
* typically because of timezone setting changes. The parameter ensures the ability to reproduce backwards
[2796] Fix | Delete
* compatible behaviors in such cases.
[2797] Fix | Delete
*
[2798] Fix | Delete
* @since 5.3.0
[2799] Fix | Delete
*
[2800] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or post object. Default is global `$post` object.
[2801] Fix | Delete
* @param string $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
[2802] Fix | Delete
* Default 'date'.
[2803] Fix | Delete
* @param string $source Optional. Local or UTC time to use from database. Accepts 'local' or 'gmt'.
[2804] Fix | Delete
* Default 'local'.
[2805] Fix | Delete
* @return DateTimeImmutable|false Time object on success, false on failure.
[2806] Fix | Delete
*/
[2807] Fix | Delete
function get_post_datetime( $post = null, $field = 'date', $source = 'local' ) {
[2808] Fix | Delete
$post = get_post( $post );
[2809] Fix | Delete
[2810] Fix | Delete
if ( ! $post ) {
[2811] Fix | Delete
return false;
[2812] Fix | Delete
}
[2813] Fix | Delete
[2814] Fix | Delete
$wp_timezone = wp_timezone();
[2815] Fix | Delete
[2816] Fix | Delete
if ( 'gmt' === $source ) {
[2817] Fix | Delete
$time = ( 'modified' === $field ) ? $post->post_modified_gmt : $post->post_date_gmt;
[2818] Fix | Delete
$timezone = new DateTimeZone( 'UTC' );
[2819] Fix | Delete
} else {
[2820] Fix | Delete
$time = ( 'modified' === $field ) ? $post->post_modified : $post->post_date;
[2821] Fix | Delete
$timezone = $wp_timezone;
[2822] Fix | Delete
}
[2823] Fix | Delete
[2824] Fix | Delete
if ( empty( $time ) || '0000-00-00 00:00:00' === $time ) {
[2825] Fix | Delete
return false;
[2826] Fix | Delete
}
[2827] Fix | Delete
[2828] Fix | Delete
$datetime = date_create_immutable_from_format( 'Y-m-d H:i:s', $time, $timezone );
[2829] Fix | Delete
[2830] Fix | Delete
if ( false === $datetime ) {
[2831] Fix | Delete
return false;
[2832] Fix | Delete
}
[2833] Fix | Delete
[2834] Fix | Delete
return $datetime->setTimezone( $wp_timezone );
[2835] Fix | Delete
}
[2836] Fix | Delete
[2837] Fix | Delete
/**
[2838] Fix | Delete
* Retrieves post published or modified time as a Unix timestamp.
[2839] Fix | Delete
*
[2840] Fix | Delete
* Note that this function returns a true Unix timestamp, not summed with timezone offset
[2841] Fix | Delete
* like older WP functions.
[2842] Fix | Delete
*
[2843] Fix | Delete
* @since 5.3.0
[2844] Fix | Delete
*
[2845] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or post object. Default is global `$post` object.
[2846] Fix | Delete
* @param string $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
[2847] Fix | Delete
* Default 'date'.
[2848] Fix | Delete
* @return int|false Unix timestamp on success, false on failure.
[2849] Fix | Delete
*/
[2850] Fix | Delete
function get_post_timestamp( $post = null, $field = 'date' ) {
[2851] Fix | Delete
$datetime = get_post_datetime( $post, $field );
[2852] Fix | Delete
[2853] Fix | Delete
if ( false === $datetime ) {
[2854] Fix | Delete
return false;
[2855] Fix | Delete
}
[2856] Fix | Delete
[2857] Fix | Delete
return $datetime->getTimestamp();
[2858] Fix | Delete
}
[2859] Fix | Delete
[2860] Fix | Delete
/**
[2861] Fix | Delete
* Displays the time at which the post was last modified.
[2862] Fix | Delete
*
[2863] Fix | Delete
* @since 2.0.0
[2864] Fix | Delete
*
[2865] Fix | Delete
* @param string $format Optional. Format to use for retrieving the time the post
[2866] Fix | Delete
* was modified. Accepts 'G', 'U', or PHP date format.
[2867] Fix | Delete
* Defaults to the 'time_format' option.
[2868] Fix | Delete
*/
[2869] Fix | Delete
function the_modified_time( $format = '' ) {
[2870] Fix | Delete
/**
[2871] Fix | Delete
* Filters the localized time a post was last modified, for display.
[2872] Fix | Delete
*
[2873] Fix | Delete
* @since 2.0.0
[2874] Fix | Delete
*
[2875] Fix | Delete
* @param string|false $get_the_modified_time The formatted time or false if no post is found.
[2876] Fix | Delete
* @param string $format Format to use for retrieving the time the post
[2877] Fix | Delete
* was modified. Accepts 'G', 'U', or PHP date format.
[2878] Fix | Delete
*/
[2879] Fix | Delete
echo apply_filters( 'the_modified_time', get_the_modified_time( $format ), $format );
[2880] Fix | Delete
}
[2881] Fix | Delete
[2882] Fix | Delete
/**
[2883] Fix | Delete
* Retrieves the time at which the post was last modified.
[2884] Fix | Delete
*
[2885] Fix | Delete
* @since 2.0.0
[2886] Fix | Delete
* @since 4.6.0 Added the `$post` parameter.
[2887] Fix | Delete
*
[2888] Fix | Delete
* @param string $format Optional. Format to use for retrieving the time the post
[2889] Fix | Delete
* was modified. Accepts 'G', 'U', or PHP date format.
[2890] Fix | Delete
* Defaults to the 'time_format' option.
[2891] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post.
[2892] Fix | Delete
* @return string|int|false Formatted date string or Unix timestamp. False on failure.
[2893] Fix | Delete
*/
[2894] Fix | Delete
function get_the_modified_time( $format = '', $post = null ) {
[2895] Fix | Delete
$post = get_post( $post );
[2896] Fix | Delete
[2897] Fix | Delete
if ( ! $post ) {
[2898] Fix | Delete
// For backward compatibility, failures go through the filter below.
[2899] Fix | Delete
$the_time = false;
[2900] Fix | Delete
} else {
[2901] Fix | Delete
$_format = ! empty( $format ) ? $format : get_option( 'time_format' );
[2902] Fix | Delete
[2903] Fix | Delete
$the_time = get_post_modified_time( $_format, false, $post, true );
[2904] Fix | Delete
}
[2905] Fix | Delete
[2906] Fix | Delete
/**
[2907] Fix | Delete
* Filters the localized time a post was last modified.
[2908] Fix | Delete
*
[2909] Fix | Delete
* @since 2.0.0
[2910] Fix | Delete
* @since 4.6.0 Added the `$post` parameter.
[2911] Fix | Delete
*
[2912] Fix | Delete
* @param string|int|false $the_time The formatted time or false if no post is found.
[2913] Fix | Delete
* @param string $format Format to use for retrieving the time the post
[2914] Fix | Delete
* was modified. Accepts 'G', 'U', or PHP date format.
[2915] Fix | Delete
* @param WP_Post|null $post WP_Post object or null if no post is found.
[2916] Fix | Delete
*/
[2917] Fix | Delete
return apply_filters( 'get_the_modified_time', $the_time, $format, $post );
[2918] Fix | Delete
}
[2919] Fix | Delete
[2920] Fix | Delete
/**
[2921] Fix | Delete
* Retrieves the time at which the post was last modified.
[2922] Fix | Delete
*
[2923] Fix | Delete
* @since 2.0.0
[2924] Fix | Delete
*
[2925] Fix | Delete
* @param string $format Optional. Format to use for retrieving the time the post
[2926] Fix | Delete
* was modified. Accepts 'G', 'U', or PHP date format. Default 'U'.
[2927] Fix | Delete
* @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
[2928] Fix | Delete
* @param int|WP_Post $post Post ID or post object. Default is global `$post` object.
[2929] Fix | Delete
* @param bool $translate Whether to translate the time string. Default false.
[2930] Fix | Delete
* @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
[2931] Fix | Delete
* False on failure.
[2932] Fix | Delete
*/
[2933] Fix | Delete
function get_post_modified_time( $format = 'U', $gmt = false, $post = null, $translate = false ) {
[2934] Fix | Delete
$post = get_post( $post );
[2935] Fix | Delete
[2936] Fix | Delete
if ( ! $post ) {
[2937] Fix | Delete
return false;
[2938] Fix | Delete
}
[2939] Fix | Delete
[2940] Fix | Delete
$source = ( $gmt ) ? 'gmt' : 'local';
[2941] Fix | Delete
$datetime = get_post_datetime( $post, 'modified', $source );
[2942] Fix | Delete
[2943] Fix | Delete
if ( false === $datetime ) {
[2944] Fix | Delete
return false;
[2945] Fix | Delete
}
[2946] Fix | Delete
[2947] Fix | Delete
if ( 'U' === $format || 'G' === $format ) {
[2948] Fix | Delete
$time = $datetime->getTimestamp();
[2949] Fix | Delete
[2950] Fix | Delete
// Returns a sum of timestamp with timezone offset. Ideally should never be used.
[2951] Fix | Delete
if ( ! $gmt ) {
[2952] Fix | Delete
$time += $datetime->getOffset();
[2953] Fix | Delete
}
[2954] Fix | Delete
} elseif ( $translate ) {
[2955] Fix | Delete
$time = wp_date( $format, $datetime->getTimestamp(), $gmt ? new DateTimeZone( 'UTC' ) : null );
[2956] Fix | Delete
} else {
[2957] Fix | Delete
if ( $gmt ) {
[2958] Fix | Delete
$datetime = $datetime->setTimezone( new DateTimeZone( 'UTC' ) );
[2959] Fix | Delete
}
[2960] Fix | Delete
[2961] Fix | Delete
$time = $datetime->format( $format );
[2962] Fix | Delete
}
[2963] Fix | Delete
[2964] Fix | Delete
/**
[2965] Fix | Delete
* Filters the localized time a post was last modified.
[2966] Fix | Delete
*
[2967] Fix | Delete
* @since 2.8.0
[2968] Fix | Delete
*
[2969] Fix | Delete
* @param string|int $time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
[2970] Fix | Delete
* @param string $format Format to use for retrieving the time the post was modified.
[2971] Fix | Delete
* Accepts 'G', 'U', or PHP date format. Default 'U'.
[2972] Fix | Delete
* @param bool $gmt Whether to retrieve the GMT time. Default false.
[2973] Fix | Delete
*/
[2974] Fix | Delete
return apply_filters( 'get_post_modified_time', $time, $format, $gmt );
[2975] Fix | Delete
}
[2976] Fix | Delete
[2977] Fix | Delete
/**
[2978] Fix | Delete
* Displays the weekday on which the post was written.
[2979] Fix | Delete
*
[2980] Fix | Delete
* @since 0.71
[2981] Fix | Delete
*
[2982] Fix | Delete
* @global WP_Locale $wp_locale WordPress date and time locale object.
[2983] Fix | Delete
*/
[2984] Fix | Delete
function the_weekday() {
[2985] Fix | Delete
global $wp_locale;
[2986] Fix | Delete
[2987] Fix | Delete
$post = get_post();
[2988] Fix | Delete
[2989] Fix | Delete
if ( ! $post ) {
[2990] Fix | Delete
return;
[2991] Fix | Delete
}
[2992] Fix | Delete
[2993] Fix | Delete
$the_weekday = $wp_locale->get_weekday( get_post_time( 'w', false, $post ) );
[2994] Fix | Delete
[2995] Fix | Delete
/**
[2996] Fix | Delete
* Filters the weekday on which the post was written, for display.
[2997] Fix | Delete
*
[2998] Fix | Delete
* @since 0.71
[2999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function