├── .gitignore ├── README.md ├── acf-hide-layout.php ├── assets ├── css │ └── style.css └── js │ └── script.js ├── languages └── acf-hide-layout.pot ├── readme.txt ├── run └── svn-exclude-list.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Composer 2 | /vendor 3 | 4 | # SVN 5 | /svn 6 | 7 | # WP-CLI 8 | wp-cli.local.yml 9 | 10 | # Created by https://www.gitignore.io/api/osx,node,linux,windows,phpstorm,composer,sublimetext,visualstudiocode 11 | # Edit at https://www.gitignore.io/?templates=osx,node,linux,windows,phpstorm,composer,sublimetext,visualstudiocode 12 | 13 | ### Composer ### 14 | composer.phar 15 | /vendor/ 16 | 17 | # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control 18 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 19 | # composer.lock 20 | 21 | ### Linux ### 22 | *~ 23 | 24 | # temporary files which can be created if a process still has a handle open of a deleted file 25 | .fuse_hidden* 26 | 27 | # KDE directory preferences 28 | .directory 29 | 30 | # Linux trash folder which might appear on any partition or disk 31 | .Trash-* 32 | 33 | # .nfs files are created when an open file is removed but is still being accessed 34 | .nfs* 35 | 36 | ### Node ### 37 | # Logs 38 | logs 39 | *.log 40 | npm-debug.log* 41 | yarn-debug.log* 42 | yarn-error.log* 43 | lerna-debug.log* 44 | 45 | # Diagnostic reports (https://nodejs.org/api/report.html) 46 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 47 | 48 | # Runtime data 49 | pids 50 | *.pid 51 | *.seed 52 | *.pid.lock 53 | 54 | # Directory for instrumented libs generated by jscoverage/JSCover 55 | lib-cov 56 | 57 | # Coverage directory used by tools like istanbul 58 | coverage 59 | 60 | # nyc test coverage 61 | .nyc_output 62 | 63 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 64 | .grunt 65 | 66 | # Bower dependency directory (https://bower.io/) 67 | bower_components 68 | 69 | # node-waf configuration 70 | .lock-wscript 71 | 72 | # Compiled binary addons (https://nodejs.org/api/addons.html) 73 | build/Release 74 | 75 | # Dependency directories 76 | node_modules/ 77 | jspm_packages/ 78 | 79 | # TypeScript v1 declaration files 80 | typings/ 81 | 82 | # Optional npm cache directory 83 | .npm 84 | 85 | # Optional eslint cache 86 | .eslintcache 87 | 88 | # Optional REPL history 89 | .node_repl_history 90 | 91 | # Output of 'npm pack' 92 | *.tgz 93 | 94 | # Yarn Integrity file 95 | .yarn-integrity 96 | 97 | # dotenv environment variables file 98 | .env.test 99 | 100 | # parcel-bundler cache (https://parceljs.org/) 101 | .cache 102 | 103 | # next.js build output 104 | .next 105 | 106 | # nuxt.js build output 107 | .nuxt 108 | 109 | # vuepress build output 110 | .vuepress/dist 111 | 112 | # Serverless directories 113 | .serverless/ 114 | 115 | # FuseBox cache 116 | .fusebox/ 117 | 118 | # DynamoDB Local files 119 | .dynamodb/ 120 | 121 | ### OSX ### 122 | # General 123 | .DS_Store 124 | .AppleDouble 125 | .LSOverride 126 | 127 | # Icon must end with two \r 128 | Icon 129 | 130 | # Thumbnails 131 | ._* 132 | 133 | # Files that might appear in the root of a volume 134 | .DocumentRevisions-V100 135 | .fseventsd 136 | .Spotlight-V100 137 | .TemporaryItems 138 | .Trashes 139 | .VolumeIcon.icns 140 | .com.apple.timemachine.donotpresent 141 | 142 | # Directories potentially created on remote AFP share 143 | .AppleDB 144 | .AppleDesktop 145 | Network Trash Folder 146 | Temporary Items 147 | .apdisk 148 | 149 | ### PhpStorm ### 150 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 151 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 152 | 153 | # User-specific stuff 154 | .idea/**/workspace.xml 155 | .idea/**/tasks.xml 156 | .idea/**/usage.statistics.xml 157 | .idea/**/dictionaries 158 | .idea/**/shelf 159 | 160 | # Generated files 161 | .idea/**/contentModel.xml 162 | 163 | # Sensitive or high-churn files 164 | .idea/**/dataSources/ 165 | .idea/**/dataSources.ids 166 | .idea/**/dataSources.local.xml 167 | .idea/**/sqlDataSources.xml 168 | .idea/**/dynamic.xml 169 | .idea/**/uiDesigner.xml 170 | .idea/**/dbnavigator.xml 171 | 172 | # Gradle 173 | .idea/**/gradle.xml 174 | .idea/**/libraries 175 | 176 | # Gradle and Maven with auto-import 177 | # When using Gradle or Maven with auto-import, you should exclude module files, 178 | # since they will be recreated, and may cause churn. Uncomment if using 179 | # auto-import. 180 | # .idea/modules.xml 181 | # .idea/*.iml 182 | # .idea/modules 183 | 184 | # CMake 185 | cmake-build-*/ 186 | 187 | # Mongo Explorer plugin 188 | .idea/**/mongoSettings.xml 189 | 190 | # File-based project format 191 | *.iws 192 | 193 | # IntelliJ 194 | out/ 195 | 196 | # mpeltonen/sbt-idea plugin 197 | .idea_modules/ 198 | 199 | # JIRA plugin 200 | atlassian-ide-plugin.xml 201 | 202 | # Cursive Clojure plugin 203 | .idea/replstate.xml 204 | 205 | # Crashlytics plugin (for Android Studio and IntelliJ) 206 | com_crashlytics_export_strings.xml 207 | crashlytics.properties 208 | crashlytics-build.properties 209 | fabric.properties 210 | 211 | # Editor-based Rest Client 212 | .idea/httpRequests 213 | 214 | # Android studio 3.1+ serialized cache file 215 | .idea/caches/build_file_checksums.ser 216 | 217 | # JetBrains templates 218 | **___jb_tmp___ 219 | 220 | ### PhpStorm Patch ### 221 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 222 | 223 | # *.iml 224 | # modules.xml 225 | # .idea/misc.xml 226 | # *.ipr 227 | 228 | # Sonarlint plugin 229 | .idea/sonarlint 230 | 231 | ### SublimeText ### 232 | # Cache files for Sublime Text 233 | *.tmlanguage.cache 234 | *.tmPreferences.cache 235 | *.stTheme.cache 236 | 237 | # Workspace files are user-specific 238 | *.sublime-workspace 239 | 240 | # Project files should be checked into the repository, unless a significant 241 | # proportion of contributors will probably not be using Sublime Text 242 | # *.sublime-project 243 | 244 | # SFTP configuration file 245 | sftp-config.json 246 | 247 | # Package control specific files 248 | Package Control.last-run 249 | Package Control.ca-list 250 | Package Control.ca-bundle 251 | Package Control.system-ca-bundle 252 | Package Control.cache/ 253 | Package Control.ca-certs/ 254 | Package Control.merged-ca-bundle 255 | Package Control.user-ca-bundle 256 | oscrypto-ca-bundle.crt 257 | bh_unicode_properties.cache 258 | 259 | # Sublime-github package stores a github token in this file 260 | # https://packagecontrol.io/packages/sublime-github 261 | GitHub.sublime-settings 262 | 263 | ### VisualStudioCode ### 264 | .vscode/* 265 | !.vscode/settings.json 266 | !.vscode/tasks.json 267 | !.vscode/launch.json 268 | !.vscode/extensions.json 269 | 270 | ### VisualStudioCode Patch ### 271 | # Ignore all local history of files 272 | .history 273 | 274 | ### Windows ### 275 | # Windows thumbnail cache files 276 | Thumbs.db 277 | ehthumbs.db 278 | ehthumbs_vista.db 279 | 280 | # Dump file 281 | *.stackdump 282 | 283 | # Folder config file 284 | [Dd]esktop.ini 285 | 286 | # Recycle Bin used on file shares 287 | $RECYCLE.BIN/ 288 | 289 | # Windows Installer files 290 | *.cab 291 | *.msi 292 | *.msix 293 | *.msm 294 | *.msp 295 | 296 | # Windows shortcuts 297 | *.lnk 298 | 299 | # End of https://www.gitignore.io/api/osx,node,linux,windows,phpstorm,composer,sublimetext,visualstudiocode 300 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ACF Hide Layout 2 | 3 | https://flyntwp.com/acf-hide-layout/ 4 | 5 | Easily hide the layout of the flexible content on the frontend but still keep it in the backend. 6 | 7 | Sometimes you may need to hide/remove a flexible content layout from showing on the frontend of the website, 8 | but you would still like to keep it in the backend in case you need to re-enable that layout again in the future. 9 | Of course you can always just remove the layout, but if it’s a complex group of fields with a lot of data, 10 | re-creating it later would be a pain. And here the **ACF Hide Layout** plugin comes into play. It adds a small button with an "eye" icon to easily disable/enable flexible layout content without removing it. 11 | 12 | ## How to use it? 13 | 14 | Next to the flexible content options "Add Layout" and "Remove Layout" is a new option "Hide / Show Layout". 15 | Toggling that option will hide or show the layout on the fronted. 16 | 17 | ## Dependencies 18 | * [WordPress](https://wordpress.org/) >= 4.7 19 | * [Advanced Custom Fields Pro](https://www.advancedcustomfields.com/pro/) >= 5.7 20 | 21 | ## Install 22 | 1. Clone this repo to `/wp-content/plugins`. 23 | 2. Activate the plugin through the 'Plugins' screen in WordPress. 24 | 25 | ## Publish the plugin to wordpress.org 26 | 27 | To publish the plugin to the official [wordpress.org/plugins/acf-hide-layout/](https://wordpress.org/plugins/acf-hide-layout/) page we will need to use SVN. Read more about about [using subversion with WordPress](https://developer.wordpress.org/plugins/wordpress-org/how-to-use-subversion/) 28 | 29 | SVN and the Plugin Directory are a release repository. Unlike Git, you shouldn’t commit every small change, as doing so can degrade performance. Please only push finished changes to your SVN repository. 30 | 31 | SVN uses the wordpress.org account username and password. The username is bleechberlin. For the initital commit SVN might ask for password for a different username (usually your OS username) but just enter empty password and then you can enter new username and password. 32 | 33 | 0. Dont't forget to update the plugin version in the `acf-hide-layout.php` and in the `readme.txt`. Don't update plugin version if you are only updating readme.txt and images in `svn/assets`. 34 | 1. Make sure you have SVN installed. 35 | * To install it with homebrew run `brew install subversion`. 36 | 2. Run `./run svn_setup`. 37 | * This will create a new folder `svn` and connect it with plugin SVN repository. 38 | 3. When you have made changes to the plugin use `./run svn_update_trunk`. 39 | * This will copy all the plugin folders and files to `svn/trunk` folder (except those in the `svn-exclude-list.txt`). 40 | 4. Go into `svn` folder with `cd svn` and use `svn` commands to add, commit/push the changes. Here are few useful commands 41 | * `svn up` Update SVN repository, like `git pull` 42 | * `svn status` See status of files, e.g. which are added (A), modified(M) or not added(?) 43 | * `svn add trunk/*` Adds all files in the trunk folder 44 | * `svn ci -m 'feat: add something new'` Commits and pushes the changes 45 | * `svn cp trunk tags/1.1` Create tag 1.1. Commit it `svn ci -m "tagging version 1.1"` 46 | 47 | Read more about ["Tagging" New Versions](https://developer.wordpress.org/plugins/wordpress-org/how-to-use-subversion/#tagging-new-versions) 48 | 49 | ## Maintainers 50 | This project is maintained by [bleech](https://github.com/bleech). 51 | 52 | ## License 53 | GPLv2 54 | -------------------------------------------------------------------------------- /acf-hide-layout.php: -------------------------------------------------------------------------------- 1 | file = __FILE__; 103 | $this->basename = plugin_basename( $this->file ); 104 | 105 | $this->init_hooks(); 106 | } 107 | 108 | /** 109 | * Get the plugin url. 110 | * 111 | * @since 1.0 112 | * @access public 113 | * 114 | * @return string 115 | */ 116 | public function get_plugin_url() { 117 | return plugin_dir_url( $this->file ); 118 | } 119 | 120 | /** 121 | * Get the plugin path. 122 | * 123 | * @since 1.0 124 | * @access public 125 | * 126 | * @return string 127 | */ 128 | public function get_plugin_path() { 129 | return plugin_dir_path( $this->file ); 130 | } 131 | 132 | /** 133 | * Retrieve the version number of the plugin. 134 | * 135 | * @since 1.0 136 | * @access public 137 | * 138 | * @return string 139 | */ 140 | public function get_version() { 141 | $plugin_data = get_file_data( $this->file, [ 'Version' => 'Version' ], 'plugin' ); 142 | return $plugin_data['Version']; 143 | } 144 | 145 | /** 146 | * Get field key. 147 | * 148 | * @since 1.0 149 | * @access public 150 | * 151 | * @return string Field key. 152 | */ 153 | public function get_field_key() { 154 | return $this->field_key; 155 | } 156 | 157 | /** 158 | * Get hidden layouts. 159 | * 160 | * @since 1.0 161 | * @access public 162 | * 163 | * @return array Hidden layouts. 164 | */ 165 | public function get_hidden_layouts() { 166 | return $this->hidden_layouts; 167 | } 168 | 169 | /** 170 | * Set hidden layout. 171 | * 172 | * @since 1.0 173 | * @access public 174 | * 175 | * @param string $field_key 176 | * @param int $row 177 | */ 178 | public function set_hidden_layout( $field_key, $row ) { 179 | $this->hidden_layouts[ $field_key ][] = 'row-' . $row; 180 | } 181 | 182 | /** 183 | * What type of request is this? 184 | * 185 | * Thanks WooCommerce 186 | * @see https://github.com/woocommerce/woocommerce/blob/master/includes/class-woocommerce.php#L304 187 | * 188 | * @since 1.0 189 | * @access public 190 | * 191 | * @param string $type admin, ajax, cron or frontend. 192 | * 193 | * @return bool 194 | */ 195 | public function is_request( $type ) { 196 | switch ( $type ) { 197 | case 'admin': 198 | return is_admin(); 199 | case 'ajax': 200 | return wp_doing_ajax(); 201 | case 'cron': 202 | return defined( 'DOING_CRON' ); 203 | case 'frontend': 204 | return ( ! is_admin() || wp_doing_ajax() ) && ! defined( 'DOING_CRON' ) && ! wp_is_json_request(); 205 | } 206 | } 207 | 208 | /** 209 | * Hook into actions and filters. 210 | * 211 | * @since 1.0 212 | * @access private 213 | */ 214 | private function init_hooks() { 215 | add_action( 'init', [ $this, 'init' ], 0 ); 216 | add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_scripts' ] ); 217 | add_action( 'admin_footer', [ $this, 'admin_footer'] ); 218 | add_filter( 'acf/load_value/type=flexible_content', [ $this, 'load_value'], 10, 3 ); 219 | add_filter( 'acf/update_value/type=flexible_content', [ $this, 'update_value'], 10, 4 ); 220 | } 221 | 222 | /** 223 | * Init when WordPress Initialises. 224 | * 225 | * @since 1.0 226 | * @access public 227 | */ 228 | public function init() { 229 | // Set up localisation. 230 | $this->load_plugin_textdomain(); 231 | } 232 | 233 | /** 234 | * Enqueue scripts. 235 | * 236 | * @since 1.0 237 | * @access public 238 | */ 239 | public function enqueue_scripts() { 240 | $assets_url = $this->get_plugin_url() . 'assets/'; 241 | $plugin_version = $this->get_version(); 242 | 243 | wp_enqueue_style( 'acf-hide-layout', $assets_url . 'css/style.css', [], $plugin_version ); 244 | wp_enqueue_script( 'acf-hide-layout', $assets_url . 'js/script.js', ['jquery'], $plugin_version, true ); 245 | } 246 | 247 | /** 248 | * Add script options. 249 | * 250 | * admin_enqueue_scripts is to early for hidden layouts. 251 | * 252 | * @since 1.0 253 | * @access public 254 | */ 255 | public function admin_footer() { 256 | 257 | $args = [ 258 | 'hidden_layouts' => $this->get_hidden_layouts(), 259 | 'i18n' => [ 260 | 'hide_layout' => esc_html__( 'Hide / Show Layout', 'acf-hide-layout' ), 261 | ], 262 | ]; 263 | 264 | wp_localize_script( 'acf-hide-layout', 'acf_hide_layout_options', $args ); 265 | } 266 | 267 | /** 268 | * Load Localisation files. 269 | * 270 | * @since 1.0 271 | * @access public 272 | */ 273 | public function load_plugin_textdomain() { 274 | load_plugin_textdomain( 'acf-hide-layout', false, plugin_basename( dirname( $this->file ) ) . '/languages' ); 275 | } 276 | 277 | /** 278 | * Remove layouts that are hidden from frontend. 279 | * 280 | * @since 1.0 281 | * @access public 282 | * 283 | * @param mixed $layouts The value to preview. 284 | * @param string $post_id The post ID for this value. 285 | * @param array $field The field array. 286 | * 287 | * @return array $layouts 288 | */ 289 | public function load_value( $layouts, $post_id, $field ) { 290 | 291 | // bail early if no layouts 292 | if ( empty( $layouts ) ) { 293 | return $layouts; 294 | } 295 | 296 | // value must be an array 297 | $layouts = acf_get_array( $layouts ); 298 | $field_key = $this->get_field_key(); 299 | 300 | foreach ( $layouts as $row => $layout ) { 301 | 302 | $hide_layout_field = [ 303 | 'name' => "{$field['name']}_{$row}_{$field_key}", 304 | 'key' => "field_{$field_key}", 305 | ]; 306 | 307 | $is_hidden = acf_get_value( $post_id, $hide_layout_field ); 308 | 309 | if ( $is_hidden ) { 310 | // used only on admin for javascript 311 | $this->set_hidden_layout( $field['key'], $row ); 312 | 313 | // hide layout on frontend 314 | if ( $this->is_request( 'frontend' ) ) { 315 | unset( $layouts[ $row ] ); 316 | } 317 | } 318 | } 319 | 320 | return $layouts; 321 | } 322 | 323 | /** 324 | * Update the field acf_hide_layout value. 325 | * 326 | * @since 1.0 327 | * @access public 328 | * 329 | * @param mixed $rows The value to update. 330 | * @param string $post_id The post ID for this value. 331 | * @param array $field The field array. 332 | * @param mixed $original The original value before modification. 333 | * 334 | * @return mixed $rows 335 | */ 336 | public function update_value( $rows, $post_id, $field, $original ) { 337 | 338 | // bail early if no layouts or empty values 339 | if ( empty( $field['layouts'] ) || empty( $rows ) ) { 340 | return $rows; 341 | } 342 | 343 | unset( $rows['acfcloneindex'] ); 344 | 345 | $rows = array_values( $rows); 346 | $field_key = $this->get_field_key(); 347 | 348 | foreach ( $rows as $key => $row ) { 349 | 350 | // bail early if no layout reference 351 | if ( !is_array( $row ) || !isset( $row['acf_fc_layout'] ) || !isset( $row[ $field_key ] ) ) { 352 | continue; 353 | } 354 | 355 | $hide_layout_field = [ 356 | 'name' => "{$field['name']}_{$key}_{$field_key}", 357 | 'key' => "field_{$field_key}", 358 | ]; 359 | 360 | $new_value = $row[ $field_key ]; 361 | 362 | acf_update_value( $new_value, $post_id, $hide_layout_field ); 363 | } 364 | 365 | return $rows; 366 | } 367 | } 368 | 369 | ACF_Hide_Layout::instance(); 370 | -------------------------------------------------------------------------------- /assets/css/style.css: -------------------------------------------------------------------------------- 1 | .acf-icon.acf-hide-layout:before { 2 | content: '\f530'; 3 | font-family: inherit; 4 | } 5 | 6 | .acf-layout-hidden .acf-icon.acf-hide-layout:before { 7 | content: '\f177'; 8 | font-family: inherit; 9 | } 10 | 11 | .acf-flexible-content .layout .acf-fc-layout-controls .acf-icon.acf-hide-layout { 12 | visibility: hidden; 13 | } 14 | 15 | .acf-flexible-content .layout:hover .acf-fc-layout-controls .acf-icon.acf-hide-layout, 16 | .acf-flexible-content .layout.-hover .acf-fc-layout-controls .acf-icon.acf-hide-layout { 17 | visibility: visible; 18 | } 19 | 20 | /* Make hidden layout look "hidden" */ 21 | .acf-layout-hidden .acf-fields { 22 | opacity: 0.5; 23 | cursor: not-allowed; 24 | } 25 | 26 | .acf-layout-hidden .acf-fields > * { 27 | pointer-events: none; 28 | } 29 | 30 | .acf-layout-hidden .acf-fc-layout-handle { 31 | background: rgba(0,0,0,.02); 32 | opacity: .7; 33 | } 34 | -------------------------------------------------------------------------------- /assets/js/script.js: -------------------------------------------------------------------------------- 1 | (function( $ ) { 2 | 'use strict'; 3 | 4 | if ( window.acf ) { 5 | window.acf.addAction( 'ready_field/type=flexible_content', function( field ) { 6 | var get_hidden_layouts = function ( field_name ) { 7 | var hidden_layouts = []; 8 | $.each( window.acf_hide_layout_options.hidden_layouts, function( key, layouts ) { 9 | if ( -1 !== field_name.indexOf( key ) ) { 10 | hidden_layouts = layouts; 11 | return false; 12 | } 13 | }); 14 | 15 | return hidden_layouts; 16 | }; 17 | 18 | // for each layout in the flexible field 19 | field.$el.find( '.layout' ).each(function( i, element ) { 20 | var $el = $( element ), 21 | $controls = $el.find( '.acf-fc-layout-controls' ).first(), 22 | $input = $el.find( 'input[type="hidden"]' ).first(), 23 | index = $el.attr( 'data-id' ), 24 | name = $input.attr( 'name' ).replace( 'acf_fc_layout', 'acf_hide_layout' ), 25 | hidden_layouts = get_hidden_layouts( name ), 26 | in_array = -1 !== $.inArray( index, hidden_layouts ), 27 | is_hidden = in_array && 'acfcloneindex' !== index; 28 | 29 | if ($el.data('has-acf-hide-layout')) { 30 | return; 31 | } 32 | 33 | $el.attr('data-has-acf-hide-layout', true) 34 | 35 | var $input = $( '', { 36 | type: 'hidden', 37 | name: name, 38 | class: 'acf-hide-layout', 39 | value: is_hidden ? '1' : '0', 40 | }); 41 | 42 | var $action = $( '', { 43 | 'data-index': index, 44 | 'data-name': 'hide-layout', 45 | href: '#', 46 | title: window.acf_hide_layout_options.i18n.hide_layout, 47 | class: 'acf-icon dashicons acf-hide-layout small light acf-js-tooltip', 48 | }); 49 | 50 | $action.prepend( $input ); 51 | $controls.prepend( $action ); 52 | 53 | if ( is_hidden ) { 54 | $el.addClass( 'acf-layout-hidden' ); 55 | } 56 | }); 57 | }); 58 | } 59 | 60 | $( document ).on( 'click', '.acf-hide-layout', function() { 61 | var $el = $( this ), 62 | $layout = $el.closest( '.layout' ), 63 | $input = $el.find( '.acf-hide-layout' ), 64 | value = $input.val(), 65 | newValue = value === '1' ? '0' : '1'; 66 | 67 | $input.val(newValue); 68 | $layout.toggleClass( 'acf-layout-hidden', newValue ); 69 | }); 70 | 71 | })( jQuery ); 72 | -------------------------------------------------------------------------------- /languages/acf-hide-layout.pot: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 bleech 2 | # This file is distributed under the same license as the ACF Hide Layout plugin. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: ACF Hide Layout 1.0\n" 6 | "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/acf-hide-layout\n" 7 | "Last-Translator: FULL NAME \n" 8 | "Language-Team: LANGUAGE \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "POT-Creation-Date: 2020-06-24T08:56:47+00:00\n" 13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 | "X-Generator: WP-CLI 2.4.0\n" 15 | "X-Domain: acf-hide-layout\n" 16 | 17 | #. Plugin Name of the plugin 18 | msgid "ACF Hide Layout" 19 | msgstr "" 20 | 21 | #. Plugin URI of the plugin 22 | msgid "https://flyntwp.com/acf-hide-layout/" 23 | msgstr "" 24 | 25 | #. Description of the plugin 26 | msgid "Easily hide the layout of the flexible content on the frontend but still keep it in the backend." 27 | msgstr "" 28 | 29 | #. Author of the plugin 30 | msgid "bleech" 31 | msgstr "" 32 | 33 | #. Author URI of the plugin 34 | msgid "https://bleech.de/" 35 | msgstr "" 36 | 37 | #: acf-hide-layout.php:246 38 | msgid "Hide / Show Layout" 39 | msgstr "" 40 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === ACF Hide Layout === 2 | Contributors: bleechberlin 3 | Tags: acf, advanced custom fields, flexible content, hide layout 4 | Requires at least: 4.7 5 | Tested up to: 6.6 6 | Stable tag: 1.2.1 7 | Requires PHP: 5.6 8 | License: GPLv2 or later 9 | License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 | 11 | Easily hide the layout of the flexible content on the frontend but still keep it in the backend. 12 | 13 | == Description == 14 | 15 | Sometimes you may need to hide/remove a flexible content layout from showing on the frontend of the website, but you would still like to keep it in the backend in case you need to re-enable that layout again in the future. 16 | 17 | Of course you can always just remove the layout, but if it’s a complex group of fields with a lot of data, re-creating it later would be a pain. And here the **ACF Hide Layout** plugin comes into play. It adds a small button with an "eye" icon to easily disable/enable flexible layout content without removing it. 18 | 19 | See more info on the [plugin website](https://flyntwp.com/acf-hide-layout/) 20 | 21 | == Frequently Asked Questions == 22 | 23 | = How to use it? = 24 | 25 | Next to the flexible content options "Add Layout" and "Remove Layout" is a new option "Hide / Show Layout". 26 | Toggling that option will hide or show the layout on the fronted. 27 | 28 | == Screenshots == 29 | 30 | 1. Content visible on the frontend 31 | 2. Option to hide the layout 32 | 3. Hidden content on the frontend 33 | 34 | == Requirements == 35 | 36 | * [WordPress](https://wordpress.org/) >= 4.7 37 | * [Advanced Custom Fields Pro](https://www.advancedcustomfields.com/pro/) >= 5.7 38 | 39 | == Installation == 40 | 41 | 1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly. 42 | 2. Activate the plugin through the 'Plugins' screen in WordPress. 43 | 44 | == Development == 45 | 46 | The source code can be found on [GitHub](https://github.com/flyntwp/acf-hide-layout). 47 | 48 | Made by people who brought to you [Flynt - The Component Based WordPress Starter Theme](https://flyntwp.com/?utm_source=WordPress%20Plugin%20Directory&utm_medium=Link&utm_campaign=ACF%20Hide%20Layout%20Plugin) 49 | 50 | == Changelog == 51 | 52 | = 1.2.1 = 53 | * Fixed issue with PHP 8.2 warning 54 | 55 | = 1.2 = 56 | * Fixed issue with nested flexible_content 57 | 58 | = 1.1 = 59 | * Fixed issue with cloning fields 60 | 61 | = 1.0.1 = 62 | * Added German translation 63 | * Updated Greek and Dutch translations 64 | 65 | = 1.0 = 66 | * Initial Release 67 | -------------------------------------------------------------------------------- /run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SVN_URL='http://plugins.svn.wordpress.org/acf-hide-layout/' 4 | 5 | svn_setup() 6 | { 7 | svn co $SVN_URL svn 8 | } 9 | 10 | svn_update_trunk() 11 | { 12 | rsync -chaL --delete --info=progress2 --exclude-from 'svn-exclude-list.txt' ./ svn/trunk 13 | } 14 | 15 | set -x 16 | if [ "$1" == "svn_setup" ]; then 17 | svn_setup 18 | elif [ "$1" == "svn_update_trunk" ]; then 19 | svn_update_trunk 20 | fi -------------------------------------------------------------------------------- /svn-exclude-list.txt: -------------------------------------------------------------------------------- 1 | .git/ 2 | .gitignore 3 | .gitkeep 4 | .gitmodules 5 | .github/ 6 | README.md 7 | svn-exclude-list.txt 8 | node_modules/ 9 | svn/ 10 | /run --------------------------------------------------------------------------------