wp_is_file_mod_allowed example

$caps[] = 'do_not_allow';
            } else {
                $caps[] = 'unfiltered_html';
            }
            break;
        case 'edit_files':
        case 'edit_plugins':
        case 'edit_themes':
            // Disallow the file editors.             if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ) {
                $caps[] = 'do_not_allow';
            } elseif ( ! wp_is_file_mod_allowed( 'capability_edit_themes' ) ) {
                $caps[] = 'do_not_allow';
            } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
                $caps[] = 'do_not_allow';
            } else {
                $caps[] = $cap;
            }
            break;
        case 'update_plugins':
        case 'delete_plugins':
        case 'install_plugins':
        case 'upload_plugins':
        
protected $update_results = array();

    /** * Determines whether the entire automatic updater is disabled. * * @since 3.7.0 * * @return bool True if the automatic updater is disabled, false otherwise. */
    public function is_disabled() {
        // Background updates are disabled if you don't want file changes.         if ( ! wp_is_file_mod_allowed( 'automatic_updater' ) ) {
            return true;
        }

        if ( wp_installing() ) {
            return true;
        }

        // More fine grained control can be done through the WP_AUTO_UPDATE_CORE constant and filters.         $disabled = defined( 'AUTOMATIC_UPDATER_DISABLED' ) && AUTOMATIC_UPDATER_DISABLED;

        /** * Filters whether to entirely disable background updates. * * There are more fine-grained filters and controls for selective disabling. * This filter parallels the AUTOMATIC_UPDATER_DISABLED constant in name. * * This also disables update notification emails. That may change in the future. * * @since 3.7.0 * * @param bool $disabled Whether the updater should be disabled. */

function wp_download_language_pack( $download ) {
    // Check if the translation is already installed.     if ( in_array( $downloadget_available_languages(), true ) ) {
        return $download;
    }

    if ( ! wp_is_file_mod_allowed( 'download_language_pack' ) ) {
        return false;
    }

    // Confirm the translation is one we can download.     $translations = wp_get_available_translations();
    if ( ! $translations ) {
        return false;
    }
    foreach ( $translations as $translation ) {
        if ( $translation['language'] === $download ) {
            $translation_to_load = true;
            
Home | Imprint | This part of the site doesn't use cookies.