PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / 2.6.13
Search Atlas SEO – OTTO AI SEO Automation for WordPress v2.6.13
2.6.26 2.6.25 2.6.24 2.6.23 2.6.22 2.6.21 2.6.20 2.6.19 2.6.18 2.6.17 2.6.16 2.6.15 2.6.14 2.6.13 2.6.12 2.6.11 2.6.10 2.6.9 2.6.8 2.6.7 2.6.6 2.6.5 2.6.4 2.6.3 2.5.23 All 138 releases
metasync / admin / js / metasync-quick-edit.js

metasync-quick-edit.js in Search Atlas SEO – OTTO AI SEO Automation for WordPress 2.6.13, at admin/js/metasync-quick-edit.js

40 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* global metasyncQuickEditData, inlineEditPost, jQuery */
2 /**
3 * MetaSync Quick Edit Badge
4 *
5 * Extracted for Phase 5, #887.
6 * Copies the MetaSync HTML badge from the posts list into the
7 * WordPress quick-edit panel.
8 *
9 * Localized object: metasyncQuickEditData
10 * - standardPageLabel (string) Translated "Standard page" label
11 *
12 * @since Phase 5
13 */
14 (function ($) {
15 // Only runs on post/page list screens where inlineEditPost exists
16 if (typeof inlineEditPost === 'undefined') return;
17
18 // Copy badge from posts list to quick edit panel
19 var wp_inline_edit = inlineEditPost.edit;
20 inlineEditPost.edit = function (id) {
21 wp_inline_edit.apply(this, arguments);
22
23 var post_id = 0;
24 if (typeof (id) === 'object') {
25 post_id = parseInt(this.getId(id));
26 }
27
28 if (post_id > 0) {
29 var $row = $('#post-' + post_id);
30 var $badge = $row.find('.metasync-html-badge').clone();
31
32 if ($badge.length) {
33 $('.metasync-quick-edit-badge-container').html($badge);
34 } else {
35 $('.metasync-quick-edit-badge-container').html('<em>' + metasyncQuickEditData.standardPageLabel + '</em>');
36 }
37 }
38 };
39 })(jQuery);
40