Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
post-date
/
wp-content
/
plugins
/
kirki
/
pro-src
/
packages
/
kirki-pro-margin-padding
/
src
:
preview.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
(() => { /** * Function to hook into `kirkiPostMessageStylesOutput` filter. * * @param {string} styles The styles to be filtered. * @param {string|Object|int} values The control's value. * @param {Object} output The control's output argument. * @param {string} controlType The control type. * * @return {string} The filtered styles. */ const stylesOutput = (styles, values, output, controlType) => { if ("kirki-margin" !== controlType && "kirki-padding" !== controlType) { return styles; } if (!values.top && !values.right && !values.bottom && !values.left) { return styles; } const property = controlType.replace("kirki-", ""); styles += output.element + "{"; for (const position in values) { if (Object.hasOwnProperty.call(values, position)) { const value = values[position]; if ("" !== value) { styles += property + "-" + position + ": " + value + ";"; } } } styles += "}"; return styles; }; // Hook the function to the `kirkiPostMessageStylesOutput` filter. wp.hooks.addFilter("kirkiPostMessageStylesOutput", "kirki", stylesOutput); })();