Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #53858, comment 13


Ignore:
Timestamp:
08/02/2021 01:44:43 PM (4 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #53858, comment 13

    initial v1  
    33<?php
    44// Option 1: polyfill the new function (preferred solution).
    5 if ( ! function_exists( 'wp_readyonly' ) ) {
     5if ( ! function_exists( 'wp_readonly' ) ) {
    66    function wp_readonly( $readonly, $current = true, $echo = true ) {
    77        return __checked_selected_helper( $readonly, $current, $echo, 'readonly' );
     
    1010
    1111// Option 2: conditionally call the function.
    12 if ( function_exists( 'wp_readyonly' ) ) {
     12if ( function_exists( 'wp_readonly' ) ) {
    1313    $code = wp_readonly( $readonly, $current, $echo );
    1414} elseif ( PHP_VERSION_ID < 80100 ) {