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.../js/dist
File: editor.js
*/
[2500] Fix | Delete
[2501] Fix | Delete
[2502] Fix | Delete
const footer = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[2503] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[2504] Fix | Delete
viewBox: "0 0 24 24",
[2505] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[2506] Fix | Delete
fillRule: "evenodd",
[2507] Fix | Delete
d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
[2508] Fix | Delete
})
[2509] Fix | Delete
});
[2510] Fix | Delete
/* harmony default export */ const library_footer = (footer);
[2511] Fix | Delete
[2512] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js
[2513] Fix | Delete
/**
[2514] Fix | Delete
* WordPress dependencies
[2515] Fix | Delete
*/
[2516] Fix | Delete
[2517] Fix | Delete
[2518] Fix | Delete
const sidebar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[2519] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[2520] Fix | Delete
viewBox: "0 0 24 24",
[2521] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[2522] Fix | Delete
d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
[2523] Fix | Delete
})
[2524] Fix | Delete
});
[2525] Fix | Delete
/* harmony default export */ const library_sidebar = (sidebar);
[2526] Fix | Delete
[2527] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
[2528] Fix | Delete
/**
[2529] Fix | Delete
* WordPress dependencies
[2530] Fix | Delete
*/
[2531] Fix | Delete
[2532] Fix | Delete
[2533] Fix | Delete
const symbolFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[2534] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[2535] Fix | Delete
viewBox: "0 0 24 24",
[2536] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[2537] Fix | Delete
d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
[2538] Fix | Delete
})
[2539] Fix | Delete
});
[2540] Fix | Delete
/* harmony default export */ const symbol_filled = (symbolFilled);
[2541] Fix | Delete
[2542] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/get-template-part-icon.js
[2543] Fix | Delete
/**
[2544] Fix | Delete
* WordPress dependencies
[2545] Fix | Delete
*/
[2546] Fix | Delete
[2547] Fix | Delete
/**
[2548] Fix | Delete
* Helper function to retrieve the corresponding icon by name.
[2549] Fix | Delete
*
[2550] Fix | Delete
* @param {string} iconName The name of the icon.
[2551] Fix | Delete
*
[2552] Fix | Delete
* @return {Object} The corresponding icon.
[2553] Fix | Delete
*/
[2554] Fix | Delete
function getTemplatePartIcon(iconName) {
[2555] Fix | Delete
if ('header' === iconName) {
[2556] Fix | Delete
return library_header;
[2557] Fix | Delete
} else if ('footer' === iconName) {
[2558] Fix | Delete
return library_footer;
[2559] Fix | Delete
} else if ('sidebar' === iconName) {
[2560] Fix | Delete
return library_sidebar;
[2561] Fix | Delete
}
[2562] Fix | Delete
return symbol_filled;
[2563] Fix | Delete
}
[2564] Fix | Delete
[2565] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/selectors.js
[2566] Fix | Delete
/**
[2567] Fix | Delete
* WordPress dependencies
[2568] Fix | Delete
*/
[2569] Fix | Delete
[2570] Fix | Delete
[2571] Fix | Delete
[2572] Fix | Delete
[2573] Fix | Delete
[2574] Fix | Delete
[2575] Fix | Delete
[2576] Fix | Delete
[2577] Fix | Delete
[2578] Fix | Delete
[2579] Fix | Delete
[2580] Fix | Delete
/**
[2581] Fix | Delete
* Internal dependencies
[2582] Fix | Delete
*/
[2583] Fix | Delete
[2584] Fix | Delete
[2585] Fix | Delete
[2586] Fix | Delete
[2587] Fix | Delete
/**
[2588] Fix | Delete
* Shared reference to an empty object for cases where it is important to avoid
[2589] Fix | Delete
* returning a new object reference on every invocation, as in a connected or
[2590] Fix | Delete
* other pure component which performs `shouldComponentUpdate` check on props.
[2591] Fix | Delete
* This should be used as a last resort, since the normalized data should be
[2592] Fix | Delete
* maintained by the reducer result in state.
[2593] Fix | Delete
*/
[2594] Fix | Delete
const EMPTY_OBJECT = {};
[2595] Fix | Delete
[2596] Fix | Delete
/**
[2597] Fix | Delete
* Returns true if any past editor history snapshots exist, or false otherwise.
[2598] Fix | Delete
*
[2599] Fix | Delete
* @param {Object} state Global application state.
[2600] Fix | Delete
*
[2601] Fix | Delete
* @return {boolean} Whether undo history exists.
[2602] Fix | Delete
*/
[2603] Fix | Delete
const hasEditorUndo = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
[2604] Fix | Delete
return select(external_wp_coreData_namespaceObject.store).hasUndo();
[2605] Fix | Delete
});
[2606] Fix | Delete
[2607] Fix | Delete
/**
[2608] Fix | Delete
* Returns true if any future editor history snapshots exist, or false
[2609] Fix | Delete
* otherwise.
[2610] Fix | Delete
*
[2611] Fix | Delete
* @param {Object} state Global application state.
[2612] Fix | Delete
*
[2613] Fix | Delete
* @return {boolean} Whether redo history exists.
[2614] Fix | Delete
*/
[2615] Fix | Delete
const hasEditorRedo = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
[2616] Fix | Delete
return select(external_wp_coreData_namespaceObject.store).hasRedo();
[2617] Fix | Delete
});
[2618] Fix | Delete
[2619] Fix | Delete
/**
[2620] Fix | Delete
* Returns true if the currently edited post is yet to be saved, or false if
[2621] Fix | Delete
* the post has been saved.
[2622] Fix | Delete
*
[2623] Fix | Delete
* @param {Object} state Global application state.
[2624] Fix | Delete
*
[2625] Fix | Delete
* @return {boolean} Whether the post is new.
[2626] Fix | Delete
*/
[2627] Fix | Delete
function isEditedPostNew(state) {
[2628] Fix | Delete
return getCurrentPost(state).status === 'auto-draft';
[2629] Fix | Delete
}
[2630] Fix | Delete
[2631] Fix | Delete
/**
[2632] Fix | Delete
* Returns true if content includes unsaved changes, or false otherwise.
[2633] Fix | Delete
*
[2634] Fix | Delete
* @param {Object} state Editor state.
[2635] Fix | Delete
*
[2636] Fix | Delete
* @return {boolean} Whether content includes unsaved changes.
[2637] Fix | Delete
*/
[2638] Fix | Delete
function hasChangedContent(state) {
[2639] Fix | Delete
const edits = getPostEdits(state);
[2640] Fix | Delete
return 'content' in edits;
[2641] Fix | Delete
}
[2642] Fix | Delete
[2643] Fix | Delete
/**
[2644] Fix | Delete
* Returns true if there are unsaved values for the current edit session, or
[2645] Fix | Delete
* false if the editing state matches the saved or new post.
[2646] Fix | Delete
*
[2647] Fix | Delete
* @param {Object} state Global application state.
[2648] Fix | Delete
*
[2649] Fix | Delete
* @return {boolean} Whether unsaved values exist.
[2650] Fix | Delete
*/
[2651] Fix | Delete
const isEditedPostDirty = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
[2652] Fix | Delete
// Edits should contain only fields which differ from the saved post (reset
[2653] Fix | Delete
// at initial load and save complete). Thus, a non-empty edits state can be
[2654] Fix | Delete
// inferred to contain unsaved values.
[2655] Fix | Delete
const postType = getCurrentPostType(state);
[2656] Fix | Delete
const postId = getCurrentPostId(state);
[2657] Fix | Delete
return select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord('postType', postType, postId);
[2658] Fix | Delete
});
[2659] Fix | Delete
[2660] Fix | Delete
/**
[2661] Fix | Delete
* Returns true if there are unsaved edits for entities other than
[2662] Fix | Delete
* the editor's post, and false otherwise.
[2663] Fix | Delete
*
[2664] Fix | Delete
* @param {Object} state Global application state.
[2665] Fix | Delete
*
[2666] Fix | Delete
* @return {boolean} Whether there are edits or not.
[2667] Fix | Delete
*/
[2668] Fix | Delete
const hasNonPostEntityChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
[2669] Fix | Delete
const dirtyEntityRecords = select(external_wp_coreData_namespaceObject.store).__experimentalGetDirtyEntityRecords();
[2670] Fix | Delete
const {
[2671] Fix | Delete
type,
[2672] Fix | Delete
id
[2673] Fix | Delete
} = getCurrentPost(state);
[2674] Fix | Delete
return dirtyEntityRecords.some(entityRecord => entityRecord.kind !== 'postType' || entityRecord.name !== type || entityRecord.key !== id);
[2675] Fix | Delete
});
[2676] Fix | Delete
[2677] Fix | Delete
/**
[2678] Fix | Delete
* Returns true if there are no unsaved values for the current edit session and
[2679] Fix | Delete
* if the currently edited post is new (has never been saved before).
[2680] Fix | Delete
*
[2681] Fix | Delete
* @param {Object} state Global application state.
[2682] Fix | Delete
*
[2683] Fix | Delete
* @return {boolean} Whether new post and unsaved values exist.
[2684] Fix | Delete
*/
[2685] Fix | Delete
function isCleanNewPost(state) {
[2686] Fix | Delete
return !isEditedPostDirty(state) && isEditedPostNew(state);
[2687] Fix | Delete
}
[2688] Fix | Delete
[2689] Fix | Delete
/**
[2690] Fix | Delete
* Returns the post currently being edited in its last known saved state, not
[2691] Fix | Delete
* including unsaved edits. Returns an object containing relevant default post
[2692] Fix | Delete
* values if the post has not yet been saved.
[2693] Fix | Delete
*
[2694] Fix | Delete
* @param {Object} state Global application state.
[2695] Fix | Delete
*
[2696] Fix | Delete
* @return {Object} Post object.
[2697] Fix | Delete
*/
[2698] Fix | Delete
const getCurrentPost = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
[2699] Fix | Delete
const postId = getCurrentPostId(state);
[2700] Fix | Delete
const postType = getCurrentPostType(state);
[2701] Fix | Delete
const post = select(external_wp_coreData_namespaceObject.store).getRawEntityRecord('postType', postType, postId);
[2702] Fix | Delete
if (post) {
[2703] Fix | Delete
return post;
[2704] Fix | Delete
}
[2705] Fix | Delete
[2706] Fix | Delete
// This exists for compatibility with the previous selector behavior
[2707] Fix | Delete
// which would guarantee an object return based on the editor reducer's
[2708] Fix | Delete
// default empty object state.
[2709] Fix | Delete
return EMPTY_OBJECT;
[2710] Fix | Delete
});
[2711] Fix | Delete
[2712] Fix | Delete
/**
[2713] Fix | Delete
* Returns the post type of the post currently being edited.
[2714] Fix | Delete
*
[2715] Fix | Delete
* @param {Object} state Global application state.
[2716] Fix | Delete
*
[2717] Fix | Delete
* @return {string} Post type.
[2718] Fix | Delete
*/
[2719] Fix | Delete
function getCurrentPostType(state) {
[2720] Fix | Delete
return state.postType;
[2721] Fix | Delete
}
[2722] Fix | Delete
[2723] Fix | Delete
/**
[2724] Fix | Delete
* Returns the ID of the post currently being edited, or null if the post has
[2725] Fix | Delete
* not yet been saved.
[2726] Fix | Delete
*
[2727] Fix | Delete
* @param {Object} state Global application state.
[2728] Fix | Delete
*
[2729] Fix | Delete
* @return {?number} ID of current post.
[2730] Fix | Delete
*/
[2731] Fix | Delete
function getCurrentPostId(state) {
[2732] Fix | Delete
return state.postId;
[2733] Fix | Delete
}
[2734] Fix | Delete
[2735] Fix | Delete
/**
[2736] Fix | Delete
* Returns the template ID currently being rendered/edited
[2737] Fix | Delete
*
[2738] Fix | Delete
* @param {Object} state Global application state.
[2739] Fix | Delete
*
[2740] Fix | Delete
* @return {string?} Template ID.
[2741] Fix | Delete
*/
[2742] Fix | Delete
function getCurrentTemplateId(state) {
[2743] Fix | Delete
return state.templateId;
[2744] Fix | Delete
}
[2745] Fix | Delete
[2746] Fix | Delete
/**
[2747] Fix | Delete
* Returns the number of revisions of the post currently being edited.
[2748] Fix | Delete
*
[2749] Fix | Delete
* @param {Object} state Global application state.
[2750] Fix | Delete
*
[2751] Fix | Delete
* @return {number} Number of revisions.
[2752] Fix | Delete
*/
[2753] Fix | Delete
function getCurrentPostRevisionsCount(state) {
[2754] Fix | Delete
var _getCurrentPost$_link;
[2755] Fix | Delete
return (_getCurrentPost$_link = getCurrentPost(state)._links?.['version-history']?.[0]?.count) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : 0;
[2756] Fix | Delete
}
[2757] Fix | Delete
[2758] Fix | Delete
/**
[2759] Fix | Delete
* Returns the last revision ID of the post currently being edited,
[2760] Fix | Delete
* or null if the post has no revisions.
[2761] Fix | Delete
*
[2762] Fix | Delete
* @param {Object} state Global application state.
[2763] Fix | Delete
*
[2764] Fix | Delete
* @return {?number} ID of the last revision.
[2765] Fix | Delete
*/
[2766] Fix | Delete
function getCurrentPostLastRevisionId(state) {
[2767] Fix | Delete
var _getCurrentPost$_link2;
[2768] Fix | Delete
return (_getCurrentPost$_link2 = getCurrentPost(state)._links?.['predecessor-version']?.[0]?.id) !== null && _getCurrentPost$_link2 !== void 0 ? _getCurrentPost$_link2 : null;
[2769] Fix | Delete
}
[2770] Fix | Delete
[2771] Fix | Delete
/**
[2772] Fix | Delete
* Returns any post values which have been changed in the editor but not yet
[2773] Fix | Delete
* been saved.
[2774] Fix | Delete
*
[2775] Fix | Delete
* @param {Object} state Global application state.
[2776] Fix | Delete
*
[2777] Fix | Delete
* @return {Object} Object of key value pairs comprising unsaved edits.
[2778] Fix | Delete
*/
[2779] Fix | Delete
const getPostEdits = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
[2780] Fix | Delete
const postType = getCurrentPostType(state);
[2781] Fix | Delete
const postId = getCurrentPostId(state);
[2782] Fix | Delete
return select(external_wp_coreData_namespaceObject.store).getEntityRecordEdits('postType', postType, postId) || EMPTY_OBJECT;
[2783] Fix | Delete
});
[2784] Fix | Delete
[2785] Fix | Delete
/**
[2786] Fix | Delete
* Returns an attribute value of the saved post.
[2787] Fix | Delete
*
[2788] Fix | Delete
* @param {Object} state Global application state.
[2789] Fix | Delete
* @param {string} attributeName Post attribute name.
[2790] Fix | Delete
*
[2791] Fix | Delete
* @return {*} Post attribute value.
[2792] Fix | Delete
*/
[2793] Fix | Delete
function getCurrentPostAttribute(state, attributeName) {
[2794] Fix | Delete
switch (attributeName) {
[2795] Fix | Delete
case 'type':
[2796] Fix | Delete
return getCurrentPostType(state);
[2797] Fix | Delete
case 'id':
[2798] Fix | Delete
return getCurrentPostId(state);
[2799] Fix | Delete
default:
[2800] Fix | Delete
const post = getCurrentPost(state);
[2801] Fix | Delete
if (!post.hasOwnProperty(attributeName)) {
[2802] Fix | Delete
break;
[2803] Fix | Delete
}
[2804] Fix | Delete
return getPostRawValue(post[attributeName]);
[2805] Fix | Delete
}
[2806] Fix | Delete
}
[2807] Fix | Delete
[2808] Fix | Delete
/**
[2809] Fix | Delete
* Returns a single attribute of the post being edited, preferring the unsaved
[2810] Fix | Delete
* edit if one exists, but merging with the attribute value for the last known
[2811] Fix | Delete
* saved state of the post (this is needed for some nested attributes like meta).
[2812] Fix | Delete
*
[2813] Fix | Delete
* @param {Object} state Global application state.
[2814] Fix | Delete
* @param {string} attributeName Post attribute name.
[2815] Fix | Delete
*
[2816] Fix | Delete
* @return {*} Post attribute value.
[2817] Fix | Delete
*/
[2818] Fix | Delete
const getNestedEditedPostProperty = (0,external_wp_data_namespaceObject.createSelector)((state, attributeName) => {
[2819] Fix | Delete
const edits = getPostEdits(state);
[2820] Fix | Delete
if (!edits.hasOwnProperty(attributeName)) {
[2821] Fix | Delete
return getCurrentPostAttribute(state, attributeName);
[2822] Fix | Delete
}
[2823] Fix | Delete
return {
[2824] Fix | Delete
...getCurrentPostAttribute(state, attributeName),
[2825] Fix | Delete
...edits[attributeName]
[2826] Fix | Delete
};
[2827] Fix | Delete
}, (state, attributeName) => [getCurrentPostAttribute(state, attributeName), getPostEdits(state)[attributeName]]);
[2828] Fix | Delete
[2829] Fix | Delete
/**
[2830] Fix | Delete
* Returns a single attribute of the post being edited, preferring the unsaved
[2831] Fix | Delete
* edit if one exists, but falling back to the attribute for the last known
[2832] Fix | Delete
* saved state of the post.
[2833] Fix | Delete
*
[2834] Fix | Delete
* @param {Object} state Global application state.
[2835] Fix | Delete
* @param {string} attributeName Post attribute name.
[2836] Fix | Delete
*
[2837] Fix | Delete
* @return {*} Post attribute value.
[2838] Fix | Delete
*/
[2839] Fix | Delete
function getEditedPostAttribute(state, attributeName) {
[2840] Fix | Delete
// Special cases.
[2841] Fix | Delete
switch (attributeName) {
[2842] Fix | Delete
case 'content':
[2843] Fix | Delete
return getEditedPostContent(state);
[2844] Fix | Delete
}
[2845] Fix | Delete
[2846] Fix | Delete
// Fall back to saved post value if not edited.
[2847] Fix | Delete
const edits = getPostEdits(state);
[2848] Fix | Delete
if (!edits.hasOwnProperty(attributeName)) {
[2849] Fix | Delete
return getCurrentPostAttribute(state, attributeName);
[2850] Fix | Delete
}
[2851] Fix | Delete
[2852] Fix | Delete
// Merge properties are objects which contain only the patch edit in state,
[2853] Fix | Delete
// and thus must be merged with the current post attribute.
[2854] Fix | Delete
if (EDIT_MERGE_PROPERTIES.has(attributeName)) {
[2855] Fix | Delete
return getNestedEditedPostProperty(state, attributeName);
[2856] Fix | Delete
}
[2857] Fix | Delete
return edits[attributeName];
[2858] Fix | Delete
}
[2859] Fix | Delete
[2860] Fix | Delete
/**
[2861] Fix | Delete
* Returns an attribute value of the current autosave revision for a post, or
[2862] Fix | Delete
* null if there is no autosave for the post.
[2863] Fix | Delete
*
[2864] Fix | Delete
* @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector
[2865] Fix | Delete
* from the '@wordpress/core-data' package and access properties on the returned
[2866] Fix | Delete
* autosave object using getPostRawValue.
[2867] Fix | Delete
*
[2868] Fix | Delete
* @param {Object} state Global application state.
[2869] Fix | Delete
* @param {string} attributeName Autosave attribute name.
[2870] Fix | Delete
*
[2871] Fix | Delete
* @return {*} Autosave attribute value.
[2872] Fix | Delete
*/
[2873] Fix | Delete
const getAutosaveAttribute = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, attributeName) => {
[2874] Fix | Delete
if (!AUTOSAVE_PROPERTIES.includes(attributeName) && attributeName !== 'preview_link') {
[2875] Fix | Delete
return;
[2876] Fix | Delete
}
[2877] Fix | Delete
const postType = getCurrentPostType(state);
[2878] Fix | Delete
[2879] Fix | Delete
// Currently template autosaving is not supported.
[2880] Fix | Delete
if (postType === 'wp_template') {
[2881] Fix | Delete
return false;
[2882] Fix | Delete
}
[2883] Fix | Delete
const postId = getCurrentPostId(state);
[2884] Fix | Delete
const currentUserId = select(external_wp_coreData_namespaceObject.store).getCurrentUser()?.id;
[2885] Fix | Delete
const autosave = select(external_wp_coreData_namespaceObject.store).getAutosave(postType, postId, currentUserId);
[2886] Fix | Delete
if (autosave) {
[2887] Fix | Delete
return getPostRawValue(autosave[attributeName]);
[2888] Fix | Delete
}
[2889] Fix | Delete
});
[2890] Fix | Delete
[2891] Fix | Delete
/**
[2892] Fix | Delete
* Returns the current visibility of the post being edited, preferring the
[2893] Fix | Delete
* unsaved value if different than the saved post. The return value is one of
[2894] Fix | Delete
* "private", "password", or "public".
[2895] Fix | Delete
*
[2896] Fix | Delete
* @param {Object} state Global application state.
[2897] Fix | Delete
*
[2898] Fix | Delete
* @return {string} Post visibility.
[2899] Fix | Delete
*/
[2900] Fix | Delete
function getEditedPostVisibility(state) {
[2901] Fix | Delete
const status = getEditedPostAttribute(state, 'status');
[2902] Fix | Delete
if (status === 'private') {
[2903] Fix | Delete
return 'private';
[2904] Fix | Delete
}
[2905] Fix | Delete
const password = getEditedPostAttribute(state, 'password');
[2906] Fix | Delete
if (password) {
[2907] Fix | Delete
return 'password';
[2908] Fix | Delete
}
[2909] Fix | Delete
return 'public';
[2910] Fix | Delete
}
[2911] Fix | Delete
[2912] Fix | Delete
/**
[2913] Fix | Delete
* Returns true if post is pending review.
[2914] Fix | Delete
*
[2915] Fix | Delete
* @param {Object} state Global application state.
[2916] Fix | Delete
*
[2917] Fix | Delete
* @return {boolean} Whether current post is pending review.
[2918] Fix | Delete
*/
[2919] Fix | Delete
function isCurrentPostPending(state) {
[2920] Fix | Delete
return getCurrentPost(state).status === 'pending';
[2921] Fix | Delete
}
[2922] Fix | Delete
[2923] Fix | Delete
/**
[2924] Fix | Delete
* Return true if the current post has already been published.
[2925] Fix | Delete
*
[2926] Fix | Delete
* @param {Object} state Global application state.
[2927] Fix | Delete
* @param {Object?} currentPost Explicit current post for bypassing registry selector.
[2928] Fix | Delete
*
[2929] Fix | Delete
* @return {boolean} Whether the post has been published.
[2930] Fix | Delete
*/
[2931] Fix | Delete
function isCurrentPostPublished(state, currentPost) {
[2932] Fix | Delete
const post = currentPost || getCurrentPost(state);
[2933] Fix | Delete
return ['publish', 'private'].indexOf(post.status) !== -1 || post.status === 'future' && !(0,external_wp_date_namespaceObject.isInTheFuture)(new Date(Number((0,external_wp_date_namespaceObject.getDate)(post.date)) - ONE_MINUTE_IN_MS));
[2934] Fix | Delete
}
[2935] Fix | Delete
[2936] Fix | Delete
/**
[2937] Fix | Delete
* Returns true if post is already scheduled.
[2938] Fix | Delete
*
[2939] Fix | Delete
* @param {Object} state Global application state.
[2940] Fix | Delete
*
[2941] Fix | Delete
* @return {boolean} Whether current post is scheduled to be posted.
[2942] Fix | Delete
*/
[2943] Fix | Delete
function isCurrentPostScheduled(state) {
[2944] Fix | Delete
return getCurrentPost(state).status === 'future' && !isCurrentPostPublished(state);
[2945] Fix | Delete
}
[2946] Fix | Delete
[2947] Fix | Delete
/**
[2948] Fix | Delete
* Return true if the post being edited can be published.
[2949] Fix | Delete
*
[2950] Fix | Delete
* @param {Object} state Global application state.
[2951] Fix | Delete
*
[2952] Fix | Delete
* @return {boolean} Whether the post can been published.
[2953] Fix | Delete
*/
[2954] Fix | Delete
function isEditedPostPublishable(state) {
[2955] Fix | Delete
const post = getCurrentPost(state);
[2956] Fix | Delete
[2957] Fix | Delete
// TODO: Post being publishable should be superset of condition of post
[2958] Fix | Delete
// being saveable. Currently this restriction is imposed at UI.
[2959] Fix | Delete
//
[2960] Fix | Delete
// See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`).
[2961] Fix | Delete
[2962] Fix | Delete
return isEditedPostDirty(state) || ['publish', 'private', 'future'].indexOf(post.status) === -1;
[2963] Fix | Delete
}
[2964] Fix | Delete
[2965] Fix | Delete
/**
[2966] Fix | Delete
* Returns true if the post can be saved, or false otherwise. A post must
[2967] Fix | Delete
* contain a title, an excerpt, or non-empty content to be valid for save.
[2968] Fix | Delete
*
[2969] Fix | Delete
* @param {Object} state Global application state.
[2970] Fix | Delete
*
[2971] Fix | Delete
* @return {boolean} Whether the post can be saved.
[2972] Fix | Delete
*/
[2973] Fix | Delete
function isEditedPostSaveable(state) {
[2974] Fix | Delete
if (isSavingPost(state)) {
[2975] Fix | Delete
return false;
[2976] Fix | Delete
}
[2977] Fix | Delete
[2978] Fix | Delete
// TODO: Post should not be saveable if not dirty. Cannot be added here at
[2979] Fix | Delete
// this time since posts where meta boxes are present can be saved even if
[2980] Fix | Delete
// the post is not dirty. Currently this restriction is imposed at UI, but
[2981] Fix | Delete
// should be moved here.
[2982] Fix | Delete
//
[2983] Fix | Delete
// See: `isEditedPostPublishable` (includes `isEditedPostDirty` condition)
[2984] Fix | Delete
// See: <PostSavedState /> (`forceIsDirty` prop)
[2985] Fix | Delete
// See: <PostPublishButton /> (`forceIsDirty` prop)
[2986] Fix | Delete
// See: https://github.com/WordPress/gutenberg/pull/4184.
[2987] Fix | Delete
[2988] Fix | Delete
return !!getEditedPostAttribute(state, 'title') || !!getEditedPostAttribute(state, 'excerpt') || !isEditedPostEmpty(state) || external_wp_element_namespaceObject.Platform.OS === 'native';
[2989] Fix | Delete
}
[2990] Fix | Delete
[2991] Fix | Delete
/**
[2992] Fix | Delete
* Returns true if the edited post has content. A post has content if it has at
[2993] Fix | Delete
* least one saveable block or otherwise has a non-empty content property
[2994] Fix | Delete
* assigned.
[2995] Fix | Delete
*
[2996] Fix | Delete
* @param {Object} state Global application state.
[2997] Fix | Delete
*
[2998] Fix | Delete
* @return {boolean} Whether post has content.
[2999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function