diff --git a/CHANGELOG.html b/CHANGELOG.html index 08b748e..3268cff 100644 --- a/CHANGELOG.html +++ b/CHANGELOG.html @@ -1,4 +1,18 @@
wa-fronted.php
and scripts.js
, separating ACF functions into a core extensionadd_action
and add_filter
)native
true
(default, setup the native editor), false
(utilize the do_action function instead)post_content
, post_title
, post_thumbnail
(note that if you don't use thepost_thumbnail() function, the image has to have the class 'attachment-post-thumbnail'), `acf{FIELD ID}/
acfsub{SUBFIELD ID}` (if set and toolbar is not specified, toolbar will set itself based on what field it is)logged-in
(enable to all logged in users), default
(default, enabled if user has capability edit_posts), {USER ROLE}
(enable to specific user role)++The javascript action hooks functions very similarly to their native PHP counterparts. Only difference is that these functions resides within the
+wa_fronted
object, so to call theadd_action
function, you type like so:wa_fronted.add_action('action_name', function);
native
is true, this action will run instead of the regular editor setup, passes 3 arguments, jQuery object of editor container, current editor options and full options objectI'll try to add hooks where I see it could be useful, but if you are missing one, please post an issue requesting it
wp_update_post
function array, use this to set your options (1 argument)++The javascript filters functions very similarly to their native PHP counterparts. Only difference is that these functions resides within the
+wa_fronted
object, so to call theadd_filter
function, you type like so:wa_fronted.add_filter('filter_name', function(value){ return value; });
I'll try to add filters where I see it could be useful, but if you are missing one, please post an issue requesting it
post_name
, post_date
and post_status
)output_to
selectors and attrsThere will be a proper how-to guide here, but for now, you can look in the extensions
folder on how to create an extension
- [new RegExp(/<\/?o:[a-z]*>/gi), '']
+ [new RegExp(/<\/?o:[a-z]*>/gi), ''],
+
+ // cleanup comments added by Chrome when pasting html
+ ['', ''],
+ ['', '']
];
}
/*jslint regexp: false*/
@@ -6129,105 +6143,133 @@ function MediumEditor(elements, options) {
},
createLink: function (opts) {
- var customEvent, i;
-
- if (opts.url && opts.url.trim().length > 0) {
- var currentSelection = this.options.contentWindow.getSelection();
- if (currentSelection) {
- var exportedSelection,
- startContainerParentElement,
- endContainerParentElement,
- textNodes;
-
- startContainerParentElement = Util.getClosestBlockContainer(currentSelection.getRangeAt(0).startContainer);
- endContainerParentElement = Util.getClosestBlockContainer(currentSelection.getRangeAt(0).endContainer);
-
- if (startContainerParentElement === endContainerParentElement) {
- var currentEditor = Selection.getSelectionElement(this.options.contentWindow),
- parentElement = (startContainerParentElement || currentEditor),
- fragment = this.options.ownerDocument.createDocumentFragment();
-
- // since we are going to create a link from an extracted text,
- // be sure that if we are updating a link, we won't let an empty link behind (see #754)
- // (Workaroung for Chrome)
- this.execAction('unlink');
-
- exportedSelection = this.exportSelection();
- fragment.appendChild(parentElement.cloneNode(true));
-
- if (currentEditor === parentElement) {
- // We have to avoid the editor itself being wiped out when it's the only block element,
- // as our reference inside this.elements gets detached from the page when insertHTML runs.
- // If we just use [parentElement, 0] and [parentElement, parentElement.childNodes.length]
- // as the range boundaries, this happens whenever parentElement === currentEditor.
- // The tradeoff to this workaround is that a orphaned tag can sometimes be left behind at
- // the end of the editor's content.
- // In Gecko:
- // as an empty if parentElement.lastChild is a tag.
- // In WebKit:
- // an invented
tag at the end in the same situation
-
- Selection.select(
- this.options.ownerDocument,
- parentElement.firstChild,
- 0,
- parentElement.lastChild,
- parentElement.lastChild.nodeType === 3 ?
- parentElement.lastChild.nodeValue.length : parentElement.lastChild.childNodes.length
- );
- } else {
- Selection.select(
+ var currentEditor, customEvent, i;
+
+ try {
+ this.events.disableCustomEvent('editableInput');
+ if (opts.url && opts.url.trim().length > 0) {
+ var currentSelection = this.options.contentWindow.getSelection();
+ if (currentSelection) {
+ var currRange = currentSelection.getRangeAt(0),
+ commonAncestorContainer = currRange.commonAncestorContainer,
+ exportedSelection,
+ startContainerParentElement,
+ endContainerParentElement,
+ textNodes;
+
+ // If the selection is contained within a single text node
+ // and the selection starts at the beginning of the text node,
+ // MSIE still says the startContainer is the parent of the text node.
+ // If the selection is contained within a single text node, we
+ // want to just use the default browser 'createLink', so we need
+ // to account for this case and adjust the commonAncestorContainer accordingly
+ if (currRange.endContainer.nodeType === 3 &&
+ currRange.startContainer.nodeType !== 3 &&
+ currRange.startOffset === 0 &&
+ currRange.startContainer.firstChild === currRange.endContainer) {
+ commonAncestorContainer = currRange.endContainer;
+ }
+
+ startContainerParentElement = Util.getClosestBlockContainer(currRange.startContainer);
+ endContainerParentElement = Util.getClosestBlockContainer(currRange.endContainer);
+
+ // If the selection is not contained within a single text node
+ // but the selection is contained within the same block element
+ // we want to make sure we create a single link, and not multiple links
+ // which can happen with the built in browser functionality
+ if (commonAncestorContainer.nodeType !== 3 && startContainerParentElement === endContainerParentElement) {
+
+ currentEditor = Selection.getSelectionElement(this.options.contentWindow);
+ var parentElement = (startContainerParentElement || currentEditor),
+ fragment = this.options.ownerDocument.createDocumentFragment();
+
+ // since we are going to create a link from an extracted text,
+ // be sure that if we are updating a link, we won't let an empty link behind (see #754)
+ // (Workaroung for Chrome)
+ this.execAction('unlink');
+
+ exportedSelection = this.exportSelection();
+ fragment.appendChild(parentElement.cloneNode(true));
+
+ if (currentEditor === parentElement) {
+ // We have to avoid the editor itself being wiped out when it's the only block element,
+ // as our reference inside this.elements gets detached from the page when insertHTML runs.
+ // If we just use [parentElement, 0] and [parentElement, parentElement.childNodes.length]
+ // as the range boundaries, this happens whenever parentElement === currentEditor.
+ // The tradeoff to this workaround is that a orphaned tag can sometimes be left behind at
+ // the end of the editor's content.
+ // In Gecko:
+ // as an empty if parentElement.lastChild is a tag.
+ // In WebKit:
+ // an invented
tag at the end in the same situation
+ Selection.select(
+ this.options.ownerDocument,
+ parentElement.firstChild,
+ 0,
+ parentElement.lastChild,
+ parentElement.lastChild.nodeType === 3 ?
+ parentElement.lastChild.nodeValue.length : parentElement.lastChild.childNodes.length
+ );
+ } else {
+ Selection.select(
+ this.options.ownerDocument,
+ parentElement,
+ 0,
+ parentElement,
+ parentElement.childNodes.length
+ );
+ }
+
+ var modifiedExportedSelection = this.exportSelection();
+
+ textNodes = Util.findOrCreateMatchingTextNodes(
this.options.ownerDocument,
- parentElement,
- 0,
- parentElement,
- parentElement.childNodes.length
+ fragment,
+ {
+ start: exportedSelection.start - modifiedExportedSelection.start,
+ end: exportedSelection.end - modifiedExportedSelection.start,
+ editableElementIndex: exportedSelection.editableElementIndex
+ }
);
- }
- var modifiedExportedSelection = this.exportSelection();
+ // Creates the link in the document fragment
+ Util.createLink(this.options.ownerDocument, textNodes, opts.url.trim());
- textNodes = Util.findOrCreateMatchingTextNodes(
- this.options.ownerDocument,
- fragment,
- {
- start: exportedSelection.start - modifiedExportedSelection.start,
- end: exportedSelection.end - modifiedExportedSelection.start,
- editableElementIndex: exportedSelection.editableElementIndex
- }
- );
-
- // Creates the link in the document fragment
- Util.createLink(this.options.ownerDocument, textNodes, opts.url.trim());
- // Chrome trims the leading whitespaces when inserting HTML, which messes up restoring the selection.
- var leadingWhitespacesCount = (fragment.firstChild.innerHTML.match(/^\s+/) || [''])[0].length;
- // Now move the created link back into the original document in a way to preserve undo/redo history
- Util.insertHTMLCommand(this.options.ownerDocument, fragment.firstChild.innerHTML.replace(/^\s+/, ''));
- exportedSelection.start -= leadingWhitespacesCount;
- exportedSelection.end -= leadingWhitespacesCount;
-
- this.importSelection(exportedSelection);
- } else {
- this.options.ownerDocument.execCommand('createLink', false, opts.url);
- }
+ // Chrome trims the leading whitespaces when inserting HTML, which messes up restoring the selection.
+ var leadingWhitespacesCount = (fragment.firstChild.innerHTML.match(/^\s+/) || [''])[0].length;
- if (this.options.targetBlank || opts.target === '_blank') {
- Util.setTargetBlank(Selection.getSelectionStart(this.options.ownerDocument), opts.url);
- }
+ // Now move the created link back into the original document in a way to preserve undo/redo history
+ Util.insertHTMLCommand(this.options.ownerDocument, fragment.firstChild.innerHTML.replace(/^\s+/, ''));
+ exportedSelection.start -= leadingWhitespacesCount;
+ exportedSelection.end -= leadingWhitespacesCount;
- if (opts.buttonClass) {
- Util.addClassToAnchors(Selection.getSelectionStart(this.options.ownerDocument), opts.buttonClass);
+ this.importSelection(exportedSelection);
+ } else {
+ this.options.ownerDocument.execCommand('createLink', false, opts.url);
+ }
+
+ if (this.options.targetBlank || opts.target === '_blank') {
+ Util.setTargetBlank(Selection.getSelectionStart(this.options.ownerDocument), opts.url);
+ }
+
+ if (opts.buttonClass) {
+ Util.addClassToAnchors(Selection.getSelectionStart(this.options.ownerDocument), opts.buttonClass);
+ }
}
}
- }
-
- if (this.options.targetBlank || opts.target === '_blank' || opts.buttonClass) {
- customEvent = this.options.ownerDocument.createEvent('HTMLEvents');
- customEvent.initEvent('input', true, true, this.options.contentWindow);
- for (i = 0; i < this.elements.length; i += 1) {
- this.elements[i].dispatchEvent(customEvent);
+ // Fire input event for backwards compatibility if anyone was listening directly to the DOM input event
+ if (this.options.targetBlank || opts.target === '_blank' || opts.buttonClass) {
+ customEvent = this.options.ownerDocument.createEvent('HTMLEvents');
+ customEvent.initEvent('input', true, true, this.options.contentWindow);
+ for (i = 0; i < this.elements.length; i += 1) {
+ this.elements[i].dispatchEvent(customEvent);
+ }
}
+ } finally {
+ this.events.enableCustomEvent('editableInput');
}
+ // Fire our custom editableInput event
+ this.events.triggerCustomEvent('editableInput', customEvent, currentEditor);
},
cleanPaste: function (text) {
@@ -6267,7 +6309,7 @@ MediumEditor.parseVersionString = function (release) {
MediumEditor.version = MediumEditor.parseVersionString.call(this, ({
// grunt-bump looks for this:
- 'version': '5.5.3'
+ 'version': '5.6.0'
}).version);
return MediumEditor;
diff --git a/bower_components/medium-editor/dist/js/medium-editor.min.js b/bower_components/medium-editor/dist/js/medium-editor.min.js
index ea84282..9e9f141 100644
--- a/bower_components/medium-editor/dist/js/medium-editor.min.js
+++ b/bower_components/medium-editor/dist/js/medium-editor.min.js
@@ -1,4 +1,5 @@
-"classList"in document.createElement("_")||!function(a){"use strict";if("Element"in a){var b="classList",c="prototype",d=a.Element[c],e=Object,f=String[c].trim||function(){return this.replace(/^\s+|\s+$/g,"")},g=Array[c].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1},h=function(a,b){this.name=a,this.code=DOMException[a],this.message=b},i=function(a,b){if(""===b)throw new h("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new h("INVALID_CHARACTER_ERR","String contains an invalid character");return g.call(a,b)},j=function(a){for(var b=f.call(a.getAttribute("class")||""),c=b?b.split(/\s+/):[],d=0,e=c.length;e>d;d++)this.push(c[d]);this._updateClassName=function(){a.setAttribute("class",this.toString())}},k=j[c]=[],l=function(){return new j(this)};if(h[c]=Error[c],k.item=function(a){return this[a]||null},k.contains=function(a){return a+="",-1!==i(this,a)},k.add=function(){var a,b=arguments,c=0,d=b.length,e=!1;do a=b[c]+"",-1===i(this,a)&&(this.push(a),e=!0);while(++cA",contentFA:''},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"x1",contentFA:''},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"x1",contentFA:''},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"image",contentFA:''},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"1.",contentFA:''},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"•",contentFA:''},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"→",contentFA:''},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"←",contentFA:''},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"C",contentFA:''},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"J",contentFA:''},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"L",contentFA:''},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"R",contentFA:''},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"X",contentFA:''},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"“",contentFA:''},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"0101",contentFA:''},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"H1",contentFA:'1'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"H2",contentFA:'2'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"H3",contentFA:'3'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"H4",contentFA:'4'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"H5",contentFA:'5'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"H6",contentFA:'6'}}}();var d;!function(){d={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}}();var e;!function(){e=function(a){b.extend(this,a)},e.extend=function(a){var c,d=this;c=a&&a.hasOwnProperty("constructor")?a.constructor:function(){return d.apply(this,arguments)},b.extend(c,d);var e=function(){this.constructor=c};return e.prototype=d.prototype,c.prototype=new e,a&&b.extend(c.prototype,a),c},e.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(a){return this.base.options[a]}},["execAction","on","off","subscribe","trigger"].forEach(function(a){e.prototype[a]=function(){return this.base[a].apply(this.base,arguments)}})}();var f;!function(){function a(a){return b.isBlockContainer(a)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}f={findMatchingSelectionParent:function(a,c){var d,e,f=c.getSelection();return 0===f.rangeCount?!1:(d=f.getRangeAt(0),e=d.commonAncestorContainer,b.traverseUp(e,a))},getSelectionElement:function(a){return this.findMatchingSelectionParent(function(a){return b.isMediumEditorElement(a)},a)},exportSelection:function(a,b){if(!a)return null;var c=null,d=b.getSelection();if(d.rangeCount>0){var e,f=d.getRangeAt(0),g=f.cloneRange();if(g.selectNodeContents(a),g.setEnd(f.startContainer,f.startOffset),e=g.toString().length,c={start:e,end:e+f.toString().length},0!==e){var h=this.getIndexRelativeToAdjacentEmptyBlocks(b,a,f.startContainer,f.startOffset);0!==h&&(c.emptyBlocksIndex=h)}}return c},importSelection:function(a,c,d,e){if(a&&c){var g=d.createRange();g.setStart(c,0),g.collapse(!0);for(var h,i=c,j=[],k=0,l=!1,m=!1;!m&&i;){if(3===i.nodeType)h=k+i.length,!l&&a.start>=k&&a.start<=h&&(g.setStart(i,a.start-k),l=!0),l&&a.end>=k&&a.end<=h&&(g.setEnd(i,a.end-k),m=!0),k=h;else for(var n=i.childNodes.length-1;n>=0;)j.push(i.childNodes[n]),n-=1;m||(i=j.pop())}if(a.emptyBlocksIndex){for(var o=b.getTopBlockContainer(g.startContainer),p=0;pA",contentFA:''},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"x1",contentFA:''},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"x1",contentFA:''},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"image",contentFA:''},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"1.",contentFA:''},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"•",contentFA:''},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"→",contentFA:''},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"←",contentFA:''},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"C",contentFA:''},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"J",contentFA:''},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"L",contentFA:''},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"R",contentFA:''},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"X",contentFA:''},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"“",contentFA:''},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"0101",contentFA:''},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"H1",contentFA:'1'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"H2",contentFA:'2'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"H3",contentFA:'3'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"H4",contentFA:'4'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"H5",contentFA:'5'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"H6",contentFA:'6'}}}();var d;!function(){d={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}}();var e;!function(){e=function(a){b.extend(this,a)},e.extend=function(a){var c,d=this;c=a&&a.hasOwnProperty("constructor")?a.constructor:function(){return d.apply(this,arguments)},b.extend(c,d);var e=function(){this.constructor=c};return e.prototype=d.prototype,c.prototype=new e,a&&b.extend(c.prototype,a),c},e.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(a){return this.base.options[a]}},["execAction","on","off","subscribe","trigger"].forEach(function(a){e.prototype[a]=function(){return this.base[a].apply(this.base,arguments)}})}();var f;!function(){function a(a){return b.isBlockContainer(a)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}f={findMatchingSelectionParent:function(a,c){var d,e,f=c.getSelection();return 0===f.rangeCount?!1:(d=f.getRangeAt(0),e=d.commonAncestorContainer,b.traverseUp(e,a))},getSelectionElement:function(a){return this.findMatchingSelectionParent(function(a){return b.isMediumEditorElement(a)},a)},exportSelection:function(a,b){if(!a)return null;var c=null,d=b.getSelection();if(d.rangeCount>0){var e,f=d.getRangeAt(0),g=f.cloneRange();if(g.selectNodeContents(a),g.setEnd(f.startContainer,f.startOffset),e=g.toString().length,c={start:e,end:e+f.toString().length},0!==e){var h=this.getIndexRelativeToAdjacentEmptyBlocks(b,a,f.startContainer,f.startOffset);0!==h&&(c.emptyBlocksIndex=h)}}return c},importSelection:function(a,c,d,e){if(a&&c){var g=d.createRange();g.setStart(c,0),g.collapse(!0);for(var h,i=c,j=[],k=0,l=!1,m=!1;!m&&i;){if(3===i.nodeType)h=k+i.length,!l&&a.start>=k&&a.start<=h&&(g.setStart(i,a.start-k),l=!0),l&&a.end>=k&&a.end<=h&&(g.setEnd(i,a.end-k),m=!0),k=h;else for(var n=i.childNodes.length-1;n>=0;)j.push(i.childNodes[n]),n-=1;m||(i=j.pop())}if(a.emptyBlocksIndex){for(var o=b.getTopBlockContainer(g.startContainer),p=0;p
]*>)?$/gi),""],[new RegExp(/\s+<\/span>/g)," "],[new RegExp(/
/g),"
"],[new RegExp(/]*(font-style:italic;font-weight:bold|font-weight:bold;font-style:italic)[^>]*>/gi),''],[new RegExp(/]*font-style:italic[^>]*>/gi),''],[new RegExp(/]*font-weight:bold[^>]*>/gi),''],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),''],[new RegExp(/<\/p>\n+/gi),"
/gi),""]]}s=e.extend({forcePlainText:!0,cleanPastedHTML:!1,cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],init:function(){e.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&this.subscribe("editablePaste",this.handlePaste.bind(this))},handlePaste:function(a,c){var d,e,f,g,h="",i="text/html",j="text/plain";if(this.window.clipboardData&&void 0===a.clipboardData&&(a.clipboardData=this.window.clipboardData,i="Text",j="Text"),a.clipboardData&&a.clipboardData.getData&&!a.defaultPrevented){if(a.preventDefault(),f=a.clipboardData.getData(i),g=a.clipboardData.getData(j),this.cleanPastedHTML&&f)return this.cleanPaste(f);if(this.getEditorOption("disableReturn")||c.getAttribute("data-disable-return"))h=b.htmlEntities(g);else if(d=g.split(/[\r\n]+/g),d.length>1)for(e=0;e
"),void this.pasteHTML("
"+d.join("
")+"
")):this.pasteHTML(b)},pasteHTML:function(a,c){c=b.defaults({},c,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags});var d,e,f,g,h=this.document.createDocumentFragment();for(h.appendChild(this.document.createElement("body")),g=h.querySelector("body"),g.innerHTML=a,this.cleanupSpans(g),d=g.querySelectorAll("*"),f=0;f/gi),""],["",""],["",""]]}s=e.extend({forcePlainText:!0,cleanPastedHTML:!1,cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],init:function(){e.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&this.subscribe("editablePaste",this.handlePaste.bind(this))},handlePaste:function(a,c){var d,e,f,g,h="",i="text/html",j="text/plain";if(this.window.clipboardData&&void 0===a.clipboardData&&(a.clipboardData=this.window.clipboardData,i="Text",j="Text"),a.clipboardData&&a.clipboardData.getData&&!a.defaultPrevented){if(a.preventDefault(),f=a.clipboardData.getData(i),g=a.clipboardData.getData(j),this.cleanPastedHTML&&f)return this.cleanPaste(f);if(this.getEditorOption("disableReturn")||c.getAttribute("data-disable-return"))h=b.htmlEntities(g);else if(d=g.split(/[\r\n]+/g),d.length>1)for(e=0;e
"),void this.pasteHTML("
"+d.join("
")+"
")):this.pasteHTML(b)},pasteHTML:function(a,c){c=b.defaults({},c,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags});var d,e,f,g,h=this.document.createDocumentFragment();for(h.appendChild(this.document.createElement("body")),g=h.querySelector("body"),g.innerHTML=a,this.cleanupSpans(g),d=g.querySelectorAll("*"),f=0;f','
','
'), '', $safe_content));
+ }else{
+ $safe_content = strip_tags($safe_content);
+ }
+ $safe_content = trim($safe_content);
+ case 'wysiwyg':
+ if($field_object['sub_field']){
+ update_sub_field($acf_field_key, $safe_content, $post_id);
+ }else{
+ update_field($acf_field_key, $safe_content, $post_id);
+ }
+ break;
+ // Saved for future use, handled by acf_form() right now
+ // case 'oembed':
+ // case 'image':
+ // case 'file':
+ // if($field_object['sub_field']){
+ // update_sub_field($acf_field_key, $safe_content, $post_id);
+ // }else{
+ // update_field($acf_field_key, $safe_content, $post_id);
+ // }
+ // break;
+ }
+ }
+ }
+ }
+}
+
+$WA_Fronted_ACF = new WA_Fronted_ACF();
\ No newline at end of file
diff --git a/js/eventmanager.js b/js/eventmanager.js
new file mode 100644
index 0000000..ec0c243
--- /dev/null
+++ b/js/eventmanager.js
@@ -0,0 +1,241 @@
+/**
+ * Curtesy of ACF
+ */
+
+/**
+ * Handles managing all events for whatever you plug it into. Priorities for hooks are based on lowest to highest in
+ * that, lowest priority hooks are fired first.
+ */
+var EventManager = function() {
+ /**
+ * Maintain a reference to the object scope so our public methods never get confusing.
+ */
+ var MethodsAvailable = {
+ removeFilter : removeFilter,
+ applyFilters : applyFilters,
+ addFilter : addFilter,
+ removeAction : removeAction,
+ doAction : doAction,
+ addAction : addAction
+ };
+
+ /**
+ * Contains the hooks that get registered with this EventManager. The array for storage utilizes a "flat"
+ * object literal such that looking up the hook utilizes the native object literal hash.
+ */
+ var STORAGE = {
+ actions : {},
+ filters : {}
+ };
+
+ /**
+ * Adds an action to the event manager.
+ *
+ * @param action Must contain namespace.identifier
+ * @param callback Must be a valid callback function before this action is added
+ * @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook
+ * @param [context] Supply a value to be used for this
+ */
+ function addAction( action, callback, priority, context ) {
+ if( typeof action === 'string' && typeof callback === 'function' ) {
+ priority = parseInt( ( priority || 10 ), 10 );
+ _addHook( 'actions', action, callback, priority, context );
+ }
+
+ return MethodsAvailable;
+ }
+
+ /**
+ * Performs an action if it exists. You can pass as many arguments as you want to this function; the only rule is
+ * that the first argument must always be the action.
+ */
+ function doAction( /* action, arg1, arg2, ... */ ) {
+ var args = Array.prototype.slice.call( arguments );
+ var action = args.shift();
+
+ if( typeof action === 'string' ) {
+ _runHook( 'actions', action, args );
+ }
+
+ return MethodsAvailable;
+ }
+
+ /**
+ * Removes the specified action if it contains a namespace.identifier & exists.
+ *
+ * @param action The action to remove
+ * @param [callback] Callback function to remove
+ */
+ function removeAction( action, callback ) {
+ if( typeof action === 'string' ) {
+ _removeHook( 'actions', action, callback );
+ }
+
+ return MethodsAvailable;
+ }
+
+ /**
+ * Adds a filter to the event manager.
+ *
+ * @param filter Must contain namespace.identifier
+ * @param callback Must be a valid callback function before this action is added
+ * @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook
+ * @param [context] Supply a value to be used for this
+ */
+ function addFilter( filter, callback, priority, context ) {
+ if( typeof filter === 'string' && typeof callback === 'function' ) {
+ priority = parseInt( ( priority || 10 ), 10 );
+ _addHook( 'filters', filter, callback, priority, context );
+ }
+
+ return MethodsAvailable;
+ }
+
+ /**
+ * Performs a filter if it exists. You should only ever pass 1 argument to be filtered. The only rule is that
+ * the first argument must always be the filter.
+ */
+ function applyFilters( /* filter, filtered arg, arg2, ... */ ) {
+ var args = Array.prototype.slice.call( arguments );
+ var filter = args.shift();
+
+ if( typeof filter === 'string' ) {
+ return _runHook( 'filters', filter, args );
+ }
+
+ return MethodsAvailable;
+ }
+
+ /**
+ * Removes the specified filter if it contains a namespace.identifier & exists.
+ *
+ * @param filter The action to remove
+ * @param [callback] Callback function to remove
+ */
+ function removeFilter( filter, callback ) {
+ if( typeof filter === 'string') {
+ _removeHook( 'filters', filter, callback );
+ }
+
+ return MethodsAvailable;
+ }
+
+ /**
+ * Removes the specified hook by resetting the value of it.
+ *
+ * @param type Type of hook, either 'actions' or 'filters'
+ * @param hook The hook (namespace.identifier) to remove
+ * @private
+ */
+ function _removeHook( type, hook, callback, context ) {
+ if ( !STORAGE[ type ][ hook ] ) {
+ return;
+ }
+ if ( !callback ) {
+ STORAGE[ type ][ hook ] = [];
+ } else {
+ var handlers = STORAGE[ type ][ hook ];
+ var i;
+ if ( !context ) {
+ for ( i = handlers.length; i--; ) {
+ if ( handlers[i].callback === callback ) {
+ handlers.splice( i, 1 );
+ }
+ }
+ }
+ else {
+ for ( i = handlers.length; i--; ) {
+ var handler = handlers[i];
+ if ( handler.callback === callback && handler.context === context) {
+ handlers.splice( i, 1 );
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Adds the hook to the appropriate storage container
+ *
+ * @param type 'actions' or 'filters'
+ * @param hook The hook (namespace.identifier) to add to our event manager
+ * @param callback The function that will be called when the hook is executed.
+ * @param priority The priority of this hook. Must be an integer.
+ * @param [context] A value to be used for this
+ * @private
+ */
+ function _addHook( type, hook, callback, priority, context ) {
+ var hookObject = {
+ callback : callback,
+ priority : priority,
+ context : context
+ };
+
+ // Utilize 'prop itself' : http://jsperf.com/hasownproperty-vs-in-vs-undefined/19
+ var hooks = STORAGE[ type ][ hook ];
+ if( hooks ) {
+ hooks.push( hookObject );
+ hooks = _hookInsertSort( hooks );
+ }
+ else {
+ hooks = [ hookObject ];
+ }
+
+ STORAGE[ type ][ hook ] = hooks;
+ }
+
+ /**
+ * Use an insert sort for keeping our hooks organized based on priority. This function is ridiculously faster
+ * than bubble sort, etc: http://jsperf.com/javascript-sort
+ *
+ * @param hooks The custom array containing all of the appropriate hooks to perform an insert sort on.
+ * @private
+ */
+ function _hookInsertSort( hooks ) {
+ var tmpHook, j, prevHook;
+ for( var i = 1, len = hooks.length; i < len; i++ ) {
+ tmpHook = hooks[ i ];
+ j = i;
+ while( ( prevHook = hooks[ j - 1 ] ) && prevHook.priority > tmpHook.priority ) {
+ hooks[ j ] = hooks[ j - 1 ];
+ --j;
+ }
+ hooks[ j ] = tmpHook;
+ }
+
+ return hooks;
+ }
+
+ /**
+ * Runs the specified hook. If it is an action, the value is not modified but if it is a filter, it is.
+ *
+ * @param type 'actions' or 'filters'
+ * @param hook The hook ( namespace.identifier ) to be ran.
+ * @param args Arguments to pass to the action/filter. If it's a filter, args is actually a single parameter.
+ * @private
+ */
+ function _runHook( type, hook, args ) {
+ var handlers = STORAGE[ type ][ hook ];
+
+ if ( !handlers ) {
+ return (type === 'filters') ? args[0] : false;
+ }
+
+ var i = 0, len = handlers.length;
+ if ( type === 'filters' ) {
+ for ( ; i < len; i++ ) {
+ args[ 0 ] = handlers[ i ].callback.apply( handlers[ i ].context, args );
+ }
+ } else {
+ for ( ; i < len; i++ ) {
+ handlers[ i ].callback.apply( handlers[ i ].context, args );
+ }
+ }
+
+ return ( type === 'filters' ) ? args[ 0 ] : true;
+ }
+
+ // return all of the publicly available methods
+ return MethodsAvailable;
+
+};
\ No newline at end of file
diff --git a/js/medium-wa-image-upload.js b/js/medium-wa-image-upload.js
index a402f50..0e3a5c1 100644
--- a/js/medium-wa-image-upload.js
+++ b/js/medium-wa-image-upload.js
@@ -22,7 +22,7 @@ function Wa_image_upload(this_options) {
*/
Wa_image_upload.prototype.setup_wp_media = function(type, shortcode_string, shortcode_wrap) {
shortcode_string = shortcode_string || false;
- shortcode_wrap = shortcode_wrap || false;
+ shortcode_wrap = shortcode_wrap || false;
var self = this;
@@ -37,35 +37,35 @@ Wa_image_upload.prototype.setup_wp_media = function(type, shortcode_string, shor
if(type === 'insert'){
this.frame = wp.media({
- frame: 'post',
- editing: true,
- multiple: false
+ frame : 'post',
+ editing : true,
+ multiple : false
});
}else if(type === 'gallery-edit' && shortcode_string !== false){
var selection = this.select(shortcode_string);
if(selection !== false){
this.frame = wp.media({
- frame: 'post',
- state: 'gallery-edit',
- title: wp.media.view.l10n.editGalleryTitle,
- editing: true,
- multiple: true,
- selection: selection
+ frame : 'post',
+ state : 'gallery-edit',
+ title : wp.media.view.l10n.editGalleryTitle,
+ editing : true,
+ multiple : true,
+ selection : selection
});
}else{
this.frame = wp.media({
- frame: 'post',
- state: 'gallery-edit',
- title: wp.media.view.l10n.editGalleryTitle,
- editing: true,
- multiple: true
+ frame : 'post',
+ state : 'gallery-edit',
+ title : wp.media.view.l10n.editGalleryTitle,
+ editing : true,
+ multiple : true
});
}
}else if(type === 'featured-image'){
this.frame = wp.media({
- frame: 'post',
- state: 'featured-image',
- states: [ new wp.media.controller.FeaturedImage() , new wp.media.controller.EditImage() ],
+ frame : 'post',
+ state : 'featured-image',
+ states : [ new wp.media.controller.FeaturedImage() , new wp.media.controller.EditImage() ],
// editing: true,
// multiple: false
});
@@ -142,11 +142,11 @@ Wa_image_upload.prototype.get_closest_image_size = function(attachment_id, heigh
width = Math.round(width),
image_type = false,
closest = {
- diff : null,
+ diff : null,
size_name : null,
- height : null,
- width : null,
- crop : null
+ height : null,
+ width : null,
+ crop : null
},
aspect_ratio = this.round(this.aspect_ratio(width, height), 2);
@@ -188,9 +188,9 @@ Wa_image_upload.prototype.get_closest_image_size = function(attachment_id, heigh
jQuery.post(
global_vars.ajax_url,
{
- 'action' : 'wa_get_image_src',
+ 'action' : 'wa_get_image_src',
'attachment_id' : attachment_id,
- 'size' : closest.size_name
+ 'size' : closest.size_name
},
function(response){
callback(response);
@@ -220,7 +220,7 @@ Wa_image_upload.prototype.bindings = function(instance, editor_container){
jQuery(event.target)
.css({
'overflow' : 'visible',
- 'margin' : ''
+ 'margin' : ''
})
.addClass(alignment);
});
@@ -304,11 +304,11 @@ Wa_image_upload.prototype.bindings = function(instance, editor_container){
Wa_image_upload.prototype.enable_resizing = function(instance, editor_container) {
var self = this;
editor_container.find('img[class*="wp-image-"]').resizable({
- autoHide: true,
- aspectRatio: true,
- ghost: true,
- handles: 'nw, ne, sw, se',
- resize: function(event, ui){
+ autoHide : true,
+ aspectRatio : true,
+ ghost : true,
+ handles : 'nw, ne, sw, se',
+ resize : function(event, ui){
var class_match = ui.element.context.className.match(/wp-image-\d+/);
if(class_match !== null){
var attachment_id = class_match[0].match(/\d+/)[0];
@@ -466,9 +466,9 @@ Wa_image_upload.prototype.insertImage = function(frame, replace_this){
html = wp.media.string.image( display );
_.each({
- align: 'align',
- size: 'image-size',
- alt: 'image_alt'
+ align : 'align',
+ size : 'image-size',
+ alt : 'image_alt'
}, function( option, prop ) {
if ( display[ prop ] )
options[ option ] = display[ prop ];
diff --git a/js/min/scripts.min.js b/js/min/scripts.min.js
index a5ba4b9..332d586 100644
--- a/js/min/scripts.min.js
+++ b/js/min/scripts.min.js
@@ -1,8 +1,9 @@
-window.Modernizr=function(e,t,n){function a(e){v.cssText=e}function i(e,t){return a(b.join(e+";")+(t||""))}function o(e,t){return typeof e===t}function r(e,t){return!!~(""+e).indexOf(t)}function s(e,t){for(var a in e){var i=e[a];if(!r(i,"-")&&v[i]!==n)return"pfx"==t?i:!0}return!1}function l(e,t,a){for(var i in e){var r=t[e[i]];if(r!==n)return a===!1?e[i]:o(r,"function")?r.bind(a||t):r}return!1}function c(e,t,n){var a=e.charAt(0).toUpperCase()+e.slice(1),i=(e+" "+j.join(a+" ")+a).split(" ");return o(t,"string")||o(t,"undefined")?s(i,t):(i=(e+" "+C.join(a+" ")+a).split(" "),l(i,t,n))}var d,u,f,p="2.8.3",m={},h=!0,_=t.documentElement,g="modernizr",y=t.createElement(g),v=y.style,b=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),w="Webkit Moz O ms",j=w.split(" "),C=w.toLowerCase().split(" "),x={},E=[],k=E.slice,Q=function(e,n,a,i){var o,r,s,l,c=t.createElement("div"),d=t.body,u=d||t.createElement("body");if(parseInt(a,10))for(;a--;)s=t.createElement("div"),s.id=i?i[a]:g+(a+1),c.appendChild(s);return o=["",'"].join(""),c.id=g,(d?c:u).innerHTML+=o,u.appendChild(c),d||(u.style.background="",u.style.overflow="hidden",l=_.style.overflow,_.style.overflow="hidden",_.appendChild(u)),r=n(c,e),d?c.parentNode.removeChild(c):(u.parentNode.removeChild(u),_.style.overflow=l),!!r},z={}.hasOwnProperty;f=o(z,"undefined")||o(z.call,"undefined")?function(e,t){return t in e&&o(e.constructor.prototype[t],"undefined")}:function(e,t){return z.call(e,t)},Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError;var n=k.call(arguments,1),a=function(){if(this instanceof a){var i=function(){};i.prototype=t.prototype;var o=new i,r=t.apply(o,n.concat(k.call(arguments)));return Object(r)===r?r:o}return t.apply(e,n.concat(k.call(arguments)))};return a}),x.opacity=function(){return i("opacity:.55"),/^0.55$/.test(v.opacity)},x.cssanimations=function(){return c("animationName")},x.csstransforms=function(){return!!c("transform")},x.csstransforms3d=function(){var e=!!c("perspective");return e&&"webkitPerspective"in _.style&&Q("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(t,n){e=9===t.offsetLeft&&3===t.offsetHeight}),e},x.csstransitions=function(){return c("transition")};for(var S in x)f(x,S)&&(u=S.toLowerCase(),m[u]=x[S](),E.push((m[u]?"":"no-")+u));return m.addTest=function(e,t){if("object"==typeof e)for(var a in e)f(e,a)&&m.addTest(a,e[a]);else{if(e=e.toLowerCase(),m[e]!==n)return m;t="function"==typeof t?t():t,"undefined"!=typeof h&&h&&(_.className+=" "+(t?"":"no-")+e),m[e]=t}return m},a(""),y=d=null,function(e,t){function n(e,t){var n=e.createElement("p"),a=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x",a.insertBefore(n.lastChild,a.firstChild)}function a(){var e=y.elements;return"string"==typeof e?e.split(" "):e}function i(e){var t=g[e[h]];return t||(t={},_++,e[h]=_,g[_]=t),t}function o(e,n,a){if(n||(n=t),d)return n.createElement(e);a||(a=i(n));var o;return o=a.cache[e]?a.cache[e].cloneNode():m.test(e)?(a.cache[e]=a.createElem(e)).cloneNode():a.createElem(e),!o.canHaveChildren||p.test(e)||o.tagUrn?o:a.frag.appendChild(o)}function r(e,n){if(e||(e=t),d)return e.createDocumentFragment();n=n||i(e);for(var o=n.frag.cloneNode(),r=0,s=a(),l=s.length;l>r;r++)o.createElement(s[r]);return o}function s(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return y.shivMethods?o(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+a().join().replace(/[\w\-]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(y,t.frag)}function l(e){e||(e=t);var a=i(e);return y.shivCSS&&!c&&!a.hasCSS&&(a.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),d||s(e,a),e}var c,d,u="3.7.0",f=e.html5||{},p=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,m=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,h="_html5shiv",_=0,g={};!function(){try{var e=t.createElement("a");e.innerHTML="
/gi),""]]}s=e.extend({forcePlainText:!0,cleanPastedHTML:!1,cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],init:function(){e.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&this.subscribe("editablePaste",this.handlePaste.bind(this))},handlePaste:function(a,c){var d,e,f,g,h="",i="text/html",j="text/plain";if(this.window.clipboardData&&void 0===a.clipboardData&&(a.clipboardData=this.window.clipboardData,i="Text",j="Text"),a.clipboardData&&a.clipboardData.getData&&!a.defaultPrevented){if(a.preventDefault(),f=a.clipboardData.getData(i),g=a.clipboardData.getData(j),this.cleanPastedHTML&&f)return this.cleanPaste(f);if(this.getEditorOption("disableReturn")||c.getAttribute("data-disable-return"))h=b.htmlEntities(g);else if(d=g.split(/[\r\n]+/g),d.length>1)for(e=0;e
"),this.pasteHTML("
"+d.join("
")+"
");try{this.document.execCommand("insertText",!1,"\n")}catch(j){}for(d=g.querySelectorAll("a,p,div,br"),c=0;c/gi),""],["",""],["",""]]}s=e.extend({forcePlainText:!0,cleanPastedHTML:!1,cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],init:function(){e.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&this.subscribe("editablePaste",this.handlePaste.bind(this))},handlePaste:function(a,c){var d,e,f,g,h="",i="text/html",j="text/plain";if(this.window.clipboardData&&void 0===a.clipboardData&&(a.clipboardData=this.window.clipboardData,i="Text",j="Text"),a.clipboardData&&a.clipboardData.getData&&!a.defaultPrevented){if(a.preventDefault(),f=a.clipboardData.getData(i),g=a.clipboardData.getData(j),this.cleanPastedHTML&&f)return this.cleanPaste(f);if(this.getEditorOption("disableReturn")||c.getAttribute("data-disable-return"))h=b.htmlEntities(g);else if(d=g.split(/[\r\n]+/g),d.length>1)for(e=0;e
"),void this.pasteHTML("
"+d.join("
")+"
")):this.pasteHTML(b)},pasteHTML:function(a,c){c=b.defaults({},c,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags});var d,e,f,g,h=this.document.createDocumentFragment();for(h.appendChild(this.document.createElement("body")),g=h.querySelector("body"),g.innerHTML=a,this.cleanupSpans(g),d=g.querySelectorAll("*"),f=0;f','
','
'), '', $safe_content));
- }else{
- $safe_content = strip_tags($safe_content);
- }
- $safe_content = trim($safe_content);
- case 'wysiwyg':
- if($field_object['sub_field']){
- update_sub_field($acf_field_key, $safe_content, $post_id);
- }else{
- update_field($acf_field_key, $safe_content, $post_id);
- }
- break;
- // Saved for future use, handled by acf_form() right now
- // case 'oembed':
- // case 'image':
- // case 'file':
- // if($field_object['sub_field']){
- // update_sub_field($acf_field_key, $safe_content, $post_id);
- // }else{
- // update_field($acf_field_key, $safe_content, $post_id);
- // }
- // break;
- }
}
}
@@ -708,178 +588,8 @@ public function wa_fronted_footer(){
}
/**
- * Output wrapper for acf dialog/popup
- */
- public function wa_acf_dialog(){
- if($_SESSION['wa_fronted_options'] !== false):
- ?>
-