├── .gitignore ├── LICENSE ├── acf-modules.php ├── assets ├── css │ ├── icon-blocks.css │ ├── icon-blocks.min.css │ ├── sections.css │ └── sections.min.css ├── js │ └── simple-content.admin.js └── sass │ ├── _mixins.scss │ ├── icon-blocks.scss │ └── sections.scss ├── gulpfile.js ├── includes ├── _init.json ├── class-acfmod-section.php ├── helpers.php └── init.php ├── modules ├── call-to-action.json ├── call-to-action.php ├── content.json ├── content.php ├── counters.json ├── counters.php ├── gravity-form.json ├── gravity-form.php ├── icon-blocks.json ├── icon-blocks.php ├── iframe.json ├── iframe.php ├── image.json ├── image.php ├── menus.json ├── menus.php ├── nav-menu.json ├── nav-menu.php ├── posts.json ├── posts.php ├── sections.json ├── sections.php ├── sidebar.json ├── sidebar.php ├── site-search.json ├── site-search.php ├── slider.json └── slider.php └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### SublimeText ### 4 | # cache files for sublime text 5 | *.tmlanguage.cache 6 | *.tmPreferences.cache 7 | *.stTheme.cache 8 | 9 | # workspace files are user-specific 10 | *.sublime-workspace 11 | 12 | # project files should be checked into the repository, unless a significant 13 | # proportion of contributors will probably not be using SublimeText 14 | # *.sublime-project 15 | 16 | # sftp configuration file 17 | sftp-config.json 18 | 19 | 20 | ### WordPress ### 21 | *.log 22 | .htaccess 23 | sitemap.xml 24 | sitemap.xml.gz 25 | wp-config.php 26 | wp-content/advanced-cache.php 27 | wp-content/backup-db/ 28 | wp-content/backups/ 29 | wp-content/blogs.dir/ 30 | wp-content/cache/ 31 | wp-content/upgrade/ 32 | wp-content/uploads/ 33 | wp-content/wp-cache-config.php 34 | 35 | 36 | ### TortoiseGit ### 37 | # Project-level settings 38 | /.tgitconfig 39 | 40 | 41 | ### OSX ### 42 | .DS_Store 43 | .AppleDouble 44 | .LSOverride 45 | 46 | # Icon must end with two \r 47 | Icon 48 | 49 | 50 | # Thumbnails 51 | ._* 52 | 53 | # Files that might appear in the root of a volume 54 | .DocumentRevisions-V100 55 | .fseventsd 56 | .Spotlight-V100 57 | .TemporaryItems 58 | .Trashes 59 | .VolumeIcon.icns 60 | 61 | # Directories potentially created on remote AFP share 62 | .AppleDB 63 | .AppleDesktop 64 | Network Trash Folder 65 | Temporary Items 66 | .apdisk 67 | 68 | 69 | ### Windows ### 70 | # Windows image file caches 71 | Thumbs.db 72 | ehthumbs.db 73 | 74 | # Folder config file 75 | Desktop.ini 76 | 77 | # Recycle Bin used on file shares 78 | $RECYCLE.BIN/ 79 | 80 | # Windows Installer files 81 | *.cab 82 | *.msi 83 | *.msm 84 | *.msp 85 | 86 | # Windows shortcuts 87 | *.lnk 88 | 89 | 90 | ### Node ### 91 | # Logs 92 | logs 93 | *.log 94 | 95 | # Runtime data 96 | pids 97 | *.pid 98 | *.seed 99 | 100 | # Directory for instrumented libs generated by jscoverage/JSCover 101 | lib-cov 102 | 103 | # Coverage directory used by tools like istanbul 104 | coverage 105 | 106 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 107 | .grunt 108 | 109 | # node-waf configuration 110 | .lock-wscript 111 | 112 | # Compiled binary addons (http://nodejs.org/api/addons.html) 113 | build/Release 114 | 115 | # Dependency directory 116 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 117 | node_modules 118 | 119 | 120 | ### Sass ### 121 | .sass-cache 122 | *.css.map 123 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /acf-modules.php: -------------------------------------------------------------------------------- 1 | current_col++; 132 | $col_width = $acfmod_sections[ $acfmod_current_section ]->get_col_width(); 133 | $section_open = $acfmod_sections[ $acfmod_current_section ]->is_open(); 134 | } 135 | 136 | if ( ! empty( $col_width ) || ! empty( $styles ) ) { 137 | $content .= ''; 152 | } 153 | 154 | $content .= '
'; 155 | 156 | if ( ! $section_open ) { 157 | if ( function_exists( 'genesis_structural_wrap' ) ) { 158 | $content .= genesis_structural_wrap( 'modular-content', 'open', false ); 159 | } 160 | } 161 | 162 | $content .= '
'; 163 | $content .= $module; 164 | $content .= '
'; 165 | 166 | if ( ! $section_open ) { 167 | if ( function_exists( 'genesis_structural_wrap' ) ) { 168 | $content .= genesis_structural_wrap( 'modular-content', 'close', false ); 169 | } 170 | } 171 | 172 | $content .= '
'; 173 | } 174 | 175 | if ( 'section_closer' === get_row_layout() ) { 176 | $content .= acfmod_close_section(); 177 | } 178 | 179 | return $content; 180 | } 181 | 182 | /* add a body class to differentiate content */ 183 | 184 | add_filter( 'body_class', 'acfmod_modular_body_class' ); 185 | 186 | /** 187 | * Add body class for module enabled pages 188 | * 189 | * @param array $body_class Body Classes array. 190 | * @return array Potentially modified array 191 | */ 192 | function acfmod_modular_body_class( $body_class ) { 193 | if ( get_queried_object_id() && have_rows( '_acfmod_modules', get_queried_object_id() ) ) { 194 | $body_class[] = 'modular'; 195 | } 196 | 197 | return $body_class; 198 | } 199 | -------------------------------------------------------------------------------- /assets/css/icon-blocks.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Responsive Mixins 3 | * @param {int} $px: 0 Max Width 4 | */ 5 | /** 6 | * Common Mixins 7 | * @return {[type]} [description] 8 | */ 9 | /** 10 | * Icon blocks 11 | */ 12 | @media only screen and (max-width: 37.5em) { 13 | .module-icon_blocks .wrap { 14 | padding-left: 0; 15 | padding-right: 0; 16 | } 17 | } 18 | 19 | .icon-blocks, 20 | .entry-content ul.icon-blocks { 21 | list-style: none; 22 | padding: 30px 0; 23 | margin-bottom: 0; 24 | margin-left: 0; 25 | } 26 | .icon-blocks li, 27 | .entry-content ul.icon-blocks li { 28 | float: left; 29 | width: 16.66%; 30 | padding: 20px 10px; 31 | text-align: center; 32 | min-height: 100%; 33 | list-style: none; 34 | -webkit-transition: all .2s ease-in-out; 35 | transition: all .2s ease-in-out; 36 | margin-bottom: 30px; 37 | } 38 | .icon-blocks li a, 39 | .entry-content ul.icon-blocks li a { 40 | display: block; 41 | padding: 0 15px; 42 | } 43 | .icon-blocks li a span, 44 | .entry-content ul.icon-blocks li a span { 45 | display: block; 46 | } 47 | .icon-blocks li a .icon, 48 | .entry-content ul.icon-blocks li a .icon { 49 | display: block; 50 | width: 128px; 51 | height: 128px; 52 | margin: 0 auto 5px; 53 | background-size: contain; 54 | background-repeat: no-repeat; 55 | } 56 | .icon-blocks li a .heading, 57 | .entry-content ul.icon-blocks li a .heading { 58 | display: block; 59 | font-size: 120%; 60 | margin-bottom: 5px; 61 | } 62 | .icon-blocks li a .text, 63 | .entry-content ul.icon-blocks li a .text { 64 | font-size: 90%; 65 | } 66 | .icon-blocks li a:hover, 67 | .entry-content ul.icon-blocks li a:hover { 68 | text-decoration: none; 69 | } 70 | .icon-blocks li:last-child, 71 | .entry-content ul.icon-blocks li:last-child { 72 | border-right: 0; 73 | } 74 | .icon-blocks.count-1 li, 75 | .entry-content ul.icon-blocks.count-1 li { 76 | float: none; 77 | } 78 | .icon-blocks.count-2 li, 79 | .entry-content ul.icon-blocks.count-2 li { 80 | width: 50%; 81 | } 82 | .icon-blocks.count-3 li, 83 | .entry-content ul.icon-blocks.count-3 li { 84 | width: 33.33%; 85 | } 86 | @media only screen and (max-width: 50em) { 87 | .icon-blocks.count-3 li, 88 | .entry-content ul.icon-blocks.count-3 li { 89 | width: 100%; 90 | float: none; 91 | } 92 | } 93 | .icon-blocks.count-6 li, 94 | .entry-content ul.icon-blocks.count-6 li { 95 | width: 33.33%; 96 | } 97 | @media only screen and (max-width: 50em) { 98 | .icon-blocks.count-6 li, 99 | .entry-content ul.icon-blocks.count-6 li { 100 | width: 50%; 101 | } 102 | } 103 | @media only screen and (max-width: 33.75em) { 104 | .icon-blocks.count-6 li, 105 | .entry-content ul.icon-blocks.count-6 li { 106 | width: 100%; 107 | float: none; 108 | } 109 | } 110 | .icon-blocks.count-4 li, .icon-blocks.count-7 li, .icon-blocks.count-8 li, 111 | .entry-content ul.icon-blocks.count-4 li, 112 | .entry-content ul.icon-blocks.count-7 li, 113 | .entry-content ul.icon-blocks.count-8 li { 114 | width: 25%; 115 | } 116 | @media only screen and (max-width: 50em) { 117 | .icon-blocks.count-4 li, .icon-blocks.count-7 li, .icon-blocks.count-8 li, 118 | .entry-content ul.icon-blocks.count-4 li, 119 | .entry-content ul.icon-blocks.count-7 li, 120 | .entry-content ul.icon-blocks.count-8 li { 121 | width: 50%; 122 | } 123 | } 124 | @media only screen and (max-width: 33.75em) { 125 | .icon-blocks.count-4 li, .icon-blocks.count-7 li, .icon-blocks.count-8 li, 126 | .entry-content ul.icon-blocks.count-4 li, 127 | .entry-content ul.icon-blocks.count-7 li, 128 | .entry-content ul.icon-blocks.count-8 li { 129 | width: 100%; 130 | float: none; 131 | } 132 | } 133 | .icon-blocks.count-5 li, .icon-blocks.count-9 li, .icon-blocks.count-10 li, 134 | .entry-content ul.icon-blocks.count-5 li, 135 | .entry-content ul.icon-blocks.count-9 li, 136 | .entry-content ul.icon-blocks.count-10 li { 137 | width: 20%; 138 | } 139 | @media only screen and (max-width: 50em) { 140 | .icon-blocks.count-5 li, .icon-blocks.count-9 li, .icon-blocks.count-10 li, 141 | .entry-content ul.icon-blocks.count-5 li, 142 | .entry-content ul.icon-blocks.count-9 li, 143 | .entry-content ul.icon-blocks.count-10 li { 144 | width: 50%; 145 | } 146 | } 147 | @media only screen and (max-width: 33.75em) { 148 | .icon-blocks.count-5 li, .icon-blocks.count-9 li, .icon-blocks.count-10 li, 149 | .entry-content ul.icon-blocks.count-5 li, 150 | .entry-content ul.icon-blocks.count-9 li, 151 | .entry-content ul.icon-blocks.count-10 li { 152 | width: 100%; 153 | float: none; 154 | } 155 | } 156 | .icon-blocks li:hover, 157 | .entry-content ul.icon-blocks li:hover { 158 | -webkit-transform: scale(1.05); 159 | -ms-transform: scale(1.05); 160 | transform: scale(1.05); 161 | background-color: #FFF; 162 | } 163 | .icon-blocks:after, 164 | .entry-content ul.icon-blocks:after { 165 | clear: both; 166 | content: ''; 167 | display: table; 168 | } 169 | -------------------------------------------------------------------------------- /assets/css/icon-blocks.min.css: -------------------------------------------------------------------------------- 1 | @media only screen and (max-width:37.5em){.module-icon_blocks .wrap{padding-left:0;padding-right:0}}.entry-content ul.icon-blocks,.icon-blocks{list-style:none;padding:30px 0;margin-bottom:0;margin-left:0}.entry-content ul.icon-blocks li,.icon-blocks li{float:left;width:16.66%;padding:20px 10px;text-align:center;min-height:100%;list-style:none;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;margin-bottom:30px}.entry-content ul.icon-blocks li a,.icon-blocks li a{display:block;padding:0 15px}.entry-content ul.icon-blocks li a span,.icon-blocks li a span{display:block}.entry-content ul.icon-blocks li a .icon,.icon-blocks li a .icon{display:block;width:128px;height:128px;margin:0 auto 5px;background-size:contain;background-repeat:no-repeat}.entry-content ul.icon-blocks li a .heading,.icon-blocks li a .heading{display:block;font-size:120%;margin-bottom:5px}.entry-content ul.icon-blocks li a .text,.icon-blocks li a .text{font-size:90%}.entry-content ul.icon-blocks li a:hover,.icon-blocks li a:hover{text-decoration:none}.entry-content ul.icon-blocks li:last-child,.icon-blocks li:last-child{border-right:0}.entry-content ul.icon-blocks.count-1 li,.icon-blocks.count-1 li{float:none}.entry-content ul.icon-blocks.count-2 li,.icon-blocks.count-2 li{width:50%}.entry-content ul.icon-blocks.count-3 li,.icon-blocks.count-3 li{width:33.33%}@media only screen and (max-width:50em){.entry-content ul.icon-blocks.count-3 li,.icon-blocks.count-3 li{width:100%;float:none}}.entry-content ul.icon-blocks.count-6 li,.icon-blocks.count-6 li{width:33.33%}@media only screen and (max-width:50em){.entry-content ul.icon-blocks.count-6 li,.icon-blocks.count-6 li{width:50%}}@media only screen and (max-width:33.75em){.entry-content ul.icon-blocks.count-6 li,.icon-blocks.count-6 li{width:100%;float:none}}.entry-content ul.icon-blocks.count-4 li,.entry-content ul.icon-blocks.count-7 li,.entry-content ul.icon-blocks.count-8 li,.icon-blocks.count-4 li,.icon-blocks.count-7 li,.icon-blocks.count-8 li{width:25%}@media only screen and (max-width:50em){.entry-content ul.icon-blocks.count-4 li,.entry-content ul.icon-blocks.count-7 li,.entry-content ul.icon-blocks.count-8 li,.icon-blocks.count-4 li,.icon-blocks.count-7 li,.icon-blocks.count-8 li{width:50%}}@media only screen and (max-width:33.75em){.entry-content ul.icon-blocks.count-4 li,.entry-content ul.icon-blocks.count-7 li,.entry-content ul.icon-blocks.count-8 li,.icon-blocks.count-4 li,.icon-blocks.count-7 li,.icon-blocks.count-8 li{width:100%;float:none}}.entry-content ul.icon-blocks.count-10 li,.entry-content ul.icon-blocks.count-5 li,.entry-content ul.icon-blocks.count-9 li,.icon-blocks.count-10 li,.icon-blocks.count-5 li,.icon-blocks.count-9 li{width:20%}@media only screen and (max-width:50em){.entry-content ul.icon-blocks.count-10 li,.entry-content ul.icon-blocks.count-5 li,.entry-content ul.icon-blocks.count-9 li,.icon-blocks.count-10 li,.icon-blocks.count-5 li,.icon-blocks.count-9 li{width:50%}}@media only screen and (max-width:33.75em){.entry-content ul.icon-blocks.count-10 li,.entry-content ul.icon-blocks.count-5 li,.entry-content ul.icon-blocks.count-9 li,.icon-blocks.count-10 li,.icon-blocks.count-5 li,.icon-blocks.count-9 li{width:100%;float:none}}.entry-content ul.icon-blocks li:hover,.icon-blocks li:hover{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05);background-color:#FFF}.entry-content ul.icon-blocks:after,.icon-blocks:after{clear:both;content:'';display:table} -------------------------------------------------------------------------------- /assets/css/sections.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Responsive Mixins 3 | * @param {int} $px: 0 Max Width 4 | */ 5 | /** 6 | * Common Mixins 7 | * @return {[type]} [description] 8 | */ 9 | /** 10 | * Sections 11 | */ 12 | .section { 13 | clear: both; 14 | padding-bottom: 30px; 15 | padding-top: 30px; 16 | } 17 | @media only screen and (max-width: 75em) { 18 | .section { 19 | padding-left: 5%; 20 | padding-right: 5%; 21 | } 22 | } 23 | .section.section-column { 24 | clear: none; 25 | padding-top: 0; 26 | padding-bottom: 0; 27 | } 28 | .section.light-gray { 29 | background-color: #fafafa; 30 | } 31 | .section.medium-gray { 32 | background-color: #999; 33 | color: #FFF; 34 | } 35 | .section.medium-gray h1, .section.medium-gray h2, .section.medium-gray h3, .section.medium-gray h4, .section.medium-gray h5, .section.medium-gray p, .section.medium-gray a { 36 | color: #FFF; 37 | } 38 | .section.dark-gray { 39 | background-color: #333; 40 | color: #FFF; 41 | } 42 | .section.dark-gray h1, .section.dark-gray h2, .section.dark-gray h3, .section.dark-gray h4, .section.dark-gray h5, .section.dark-gray p, .section.dark-gray a { 43 | color: #FFF; 44 | } 45 | .section.two-column > .module, .section.two-column > .section { 46 | width: 50%; 47 | float: left; 48 | clear: none; 49 | } 50 | @media only screen and (max-width: 37.5em) { 51 | .section.two-column > .module, .section.two-column > .section { 52 | width: 100%; 53 | float: none; 54 | } 55 | } 56 | .section.two-column:after { 57 | clear: both; 58 | content: ''; 59 | display: table; 60 | } 61 | .section.three-column > .module, .section.three-column > .section { 62 | width: 33.33%; 63 | float: left; 64 | clear: none; 65 | } 66 | .section.three-column:after { 67 | clear: both; 68 | content: ''; 69 | display: table; 70 | } 71 | .section.four-column > .module, .section.four-column > .section { 72 | width: 25%; 73 | float: left; 74 | clear: none; 75 | } 76 | .section.four-column:after { 77 | clear: both; 78 | content: ''; 79 | display: table; 80 | } 81 | .section.two-column .module-inner, .section.three-column .module-inner, .section.four-column .module-inner { 82 | padding: 0 20px; 83 | } 84 | .section.two-column .module-inner:first-child, .section.three-column .module-inner:first-child, .section.four-column .module-inner:first-child { 85 | padding-left: 0; 86 | } 87 | -------------------------------------------------------------------------------- /assets/css/sections.min.css: -------------------------------------------------------------------------------- 1 | .section.dark-gray,.section.dark-gray a,.section.dark-gray h1,.section.dark-gray h2,.section.dark-gray h3,.section.dark-gray h4,.section.dark-gray h5,.section.dark-gray p,.section.medium-gray a,.section.medium-gray h1,.section.medium-gray h2,.section.medium-gray h3,.section.medium-gray h4,.section.medium-gray h5,.section.medium-gray p{color:#FFF}.section.four-column:after,.section.three-column:after,.section.two-column:after{content:'';display:table}.section{clear:both;padding-bottom:30px;padding-top:30px}@media only screen and (max-width:75em){.section{padding-left:5%;padding-right:5%}}.section.section-column{clear:none;padding-top:0;padding-bottom:0}.section.light-gray{background-color:#fafafa}.section.medium-gray{background-color:#999;color:#FFF}.section.dark-gray{background-color:#333}.section.two-column>.module,.section.two-column>.section{width:50%;float:left;clear:none}@media only screen and (max-width:37.5em){.section.two-column>.module,.section.two-column>.section{width:100%;float:none}}.section.two-column:after{clear:both}.section.three-column>.module,.section.three-column>.section{width:33.33%;float:left;clear:none}.section.three-column:after{clear:both}.section.four-column>.module,.section.four-column>.section{width:25%;float:left;clear:none}.section.four-column:after{clear:both}.section.four-column .module-inner,.section.three-column .module-inner,.section.two-column .module-inner{padding:0 20px}.section.four-column .module-inner:first-child,.section.three-column .module-inner:first-child,.section.two-column .module-inner:first-child{padding-left:0} -------------------------------------------------------------------------------- /assets/js/simple-content.admin.js: -------------------------------------------------------------------------------- 1 | var acfmod_bind_load_content; 2 | 3 | (function($) { 4 | 5 | $(function(){ 6 | 7 | if( typeof acf == 'undefined' ) 8 | return; 9 | 10 | // this event happens when new HTML is added by acf 11 | acf.add_action('append', function( $el ){ 12 | 13 | var $cbx = $el.find('tr[data-name="load_post_content"] input[type="checkbox"]'); 14 | 15 | acfmod_bind_load_content( $cbx ); 16 | 17 | }); // acf append 18 | 19 | acfmod_bind_load_content = function( $cbx ){ 20 | $cbx.on('click', function(){ 21 | var $cbx = $(this); 22 | 23 | if( $cbx.is(':checked') ){ 24 | // show spinner 25 | var $spinner = $('
'); 26 | $cbx.parents('li:first').append( $spinner ); 27 | 28 | // make sure they're OK with this 29 | if( ! confirm( 'This will overwrite the editor content. Are you sure you want to import post_content?' ) ){ 30 | $spinner.remove(); 31 | return; 32 | } 33 | 34 | // find the correct instance of TinyMCE 35 | var $textarea = $cbx.parents('.row-layout:first').find( '.acf-editor-wrap textarea.wp-editor-area:first' ); 36 | 37 | // load the post_content 38 | $.ajax({ 39 | url: acfmod_vars.ajax_url + '?acfmod-get-post-content', 40 | data: { id: $('#post_ID').val(), action: 'acfmod_get_post_content' }, 41 | type: 'get', 42 | success: function( response ){ 43 | if( response.success ){ 44 | // insert response.post_content into the simple content editor 45 | tinymce.get( $textarea.attr('id') ).setContent( response.post_content ); 46 | 47 | // remove spinner 48 | $spinner.remove(); 49 | } 50 | } 51 | }); // ajax 52 | 53 | } // if checked 54 | 55 | }); // click function 56 | 57 | }; // acfmod_bind_load_content 58 | 59 | acfmod_bind_load_content( $('tr[data-name="load_post_content"] input[type="checkbox"]') ); 60 | 61 | }); // document ready 62 | 63 | })(jQuery); 64 | -------------------------------------------------------------------------------- /assets/sass/_mixins.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Responsive Mixins 3 | * @param {int} $px: 0 Max Width 4 | */ 5 | @mixin responsive( $px: 0 ) { 6 | $rems: $px / 16; 7 | @media only screen and (max-width: #{$rems}em) { 8 | @content; 9 | } 10 | } 11 | 12 | /** 13 | * Common Mixins 14 | * @return {[type]} [description] 15 | */ 16 | @mixin clearfix(){ 17 | clear:both; 18 | content:''; 19 | display:table; 20 | } 21 | -------------------------------------------------------------------------------- /assets/sass/icon-blocks.scss: -------------------------------------------------------------------------------- 1 | @import "mixins"; 2 | 3 | /** 4 | * Icon blocks 5 | */ 6 | 7 | .module-icon_blocks .wrap { 8 | @include responsive( 600 ){ 9 | padding-left:0; 10 | padding-right:0; 11 | } 12 | } 13 | .icon-blocks, 14 | .entry-content ul.icon-blocks { 15 | list-style: none; 16 | padding:30px 0; 17 | margin-bottom:0; 18 | margin-left:0; 19 | 20 | li { 21 | float:left; 22 | width:16.66%; 23 | padding:20px 10px; 24 | text-align: center; 25 | min-height: 100%; 26 | list-style: none; 27 | transition: all .2s ease-in-out; 28 | margin-bottom:30px; 29 | 30 | a { 31 | display: block; 32 | padding:0 15px; 33 | 34 | span { 35 | display: block; 36 | } 37 | 38 | .icon { 39 | display: block; 40 | width:128px; 41 | height:128px; 42 | margin:0 auto 5px; 43 | background-size:contain; 44 | background-repeat: no-repeat; 45 | } 46 | 47 | .heading { 48 | display: block; 49 | font-size: 120%; 50 | margin-bottom:5px; 51 | } 52 | 53 | .text { 54 | font-size:90%; 55 | } 56 | 57 | &:hover { 58 | text-decoration: none; 59 | } 60 | } 61 | 62 | &:last-child { 63 | border-right:0; 64 | } 65 | } 66 | 67 | &.count-1 li { 68 | float:none; 69 | } 70 | &.count-2 li { 71 | width:50%; 72 | } 73 | &.count-3 li { 74 | width:33.33%; 75 | @include responsive( 800 ){ 76 | width:100%; 77 | float:none; 78 | } 79 | } 80 | &.count-6 li { 81 | width:33.33%; 82 | @include responsive( 800 ){ 83 | width:50%; 84 | } 85 | @include responsive( 540 ){ 86 | width:100%; 87 | float:none; 88 | } 89 | } 90 | &.count-4 li, 91 | &.count-7 li, 92 | &.count-8 li { 93 | width:25%; 94 | @include responsive( 800 ){ 95 | width:50%; 96 | } 97 | @include responsive( 540 ){ 98 | width:100%; 99 | float:none; 100 | } 101 | } 102 | &.count-5 li, 103 | &.count-9 li, 104 | &.count-10 li { 105 | width:20%; 106 | @include responsive( 800 ){ 107 | width:50%; 108 | } 109 | @include responsive( 540 ){ 110 | width:100%; 111 | float:none; 112 | } 113 | } 114 | 115 | & li:hover { 116 | transform: scale(1.05); 117 | background-color:#FFF; 118 | } 119 | 120 | &:after { 121 | @include clearfix(); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /assets/sass/sections.scss: -------------------------------------------------------------------------------- 1 | @import "mixins"; 2 | 3 | /** 4 | * Sections 5 | */ 6 | 7 | .section { 8 | clear:both; 9 | padding-bottom:30px; 10 | padding-top:30px; 11 | 12 | @include responsive( 1200 ){ 13 | padding-left:5%; 14 | padding-right:5%; 15 | } 16 | 17 | &.section-column { 18 | clear:none; 19 | padding-top:0; 20 | padding-bottom:0; 21 | } 22 | 23 | &.light-gray { 24 | background-color: #fafafa; 25 | } 26 | &.medium-gray { 27 | background-color:#999; 28 | color:#FFF; 29 | h1, h2, h3, h4, h5, p, a { 30 | color:#FFF; 31 | } 32 | } 33 | &.dark-gray { 34 | background-color:#333; 35 | color:#FFF; 36 | h1, h2, h3, h4, h5, p, a { 37 | color:#FFF; 38 | } 39 | } 40 | &.two-column { 41 | & > .module, & > .section { 42 | width:50%; 43 | float:left; 44 | clear:none; 45 | 46 | @include responsive( 600 ){ 47 | width:100%; 48 | float:none; 49 | } 50 | } 51 | 52 | &:after { 53 | @include clearfix(); 54 | } 55 | } 56 | &.three-column { 57 | & > .module, & > .section { 58 | width:33.33%; 59 | float:left; 60 | clear:none; 61 | } 62 | 63 | &:after { 64 | @include clearfix(); 65 | } 66 | } 67 | &.four-column { 68 | & > .module, & > .section { 69 | width:25%; 70 | float:left; 71 | clear:none; 72 | } 73 | 74 | &:after { 75 | @include clearfix(); 76 | } 77 | } 78 | &.two-column, 79 | &.three-column, 80 | &.four-column { 81 | .module-inner { 82 | padding:0 20px; 83 | &:first-child { 84 | padding-left:0; 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | // Load plugins 2 | var gulp = require('gulp'); 3 | var plugins = require('gulp-load-plugins')({ camelize: true, lazy: false }); 4 | 5 | gulp.task('styles', function() { 6 | return plugins.rubySass('assets/sass', { 7 | style: 'expanded', 8 | compass: true 9 | }) 10 | .pipe(plugins.autoprefixer('last 2 versions', 'ie 9', 'ios 6', 'android 4')) 11 | .pipe(gulp.dest('assets/css')) 12 | .pipe(plugins.rename({ suffix: '.min' })) 13 | .pipe(plugins.minifyCss({ keepSpecialComments: 1 })) 14 | .pipe(plugins.livereload()) 15 | .pipe(gulp.dest('assets/css')); 16 | //.pipe(plugins.notify({ message: 'Styles task complete' })); 17 | }); 18 | 19 | // Scripts 20 | /*gulp.task('scripts', function() { 21 | return gulp.src(['assets/js/source/*.js']) 22 | .pipe(plugins.jshint('.jshintrc')) 23 | .pipe(plugins.jshint.reporter('default')) 24 | .pipe(plugins.concat('main.js')) 25 | .pipe(gulp.dest('assets/js/build')) 26 | .pipe(plugins.rename({ suffix: '.min' })) 27 | .pipe(plugins.uglify()) 28 | .pipe(plugins.livereload()) 29 | .pipe(gulp.dest('assets/js')); 30 | //.pipe(plugins.notify({ message: 'Scripts task complete' })); 31 | });*/ 32 | 33 | // Watch 34 | gulp.task('watch', function() { 35 | 36 | // Watch .scss files 37 | gulp.watch('assets/sass/**/*.scss', ['styles']); 38 | 39 | // Watch .js files 40 | //gulp.watch(['assets/js/source/*.js'], ['scripts']); 41 | 42 | // Watch .php files 43 | // gulp.watch(['*.php', '**/*.php']).on('change', function(file) { 44 | // plugins.livereload().changed(file.path); 45 | // }); 46 | 47 | }); 48 | 49 | // Default task 50 | gulp.task('default', ['styles', /*'scripts',*/ 'watch']); 51 | -------------------------------------------------------------------------------- /includes/_init.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "key":"group_543c1c5fdde54", 4 | "title":"Content Modules", 5 | "fields":[ 6 | { 7 | "key":"field_543d7bc015b3d", 8 | "label":"Modules", 9 | "name":"_acfmod_modules", 10 | "type":"flexible_content", 11 | "instructions":"Create many different types of content by selecting the module and filling in the fields.", 12 | "required":0, 13 | "conditional_logic":0, 14 | "wrapper":{ 15 | "width":"", 16 | "class":"", 17 | "id":"" 18 | }, 19 | "button_label":"Add Module", 20 | "min":0, 21 | "max":"", 22 | "layouts":[] 23 | } 24 | ], 25 | "location":[ 26 | [ 27 | { 28 | "param":"post_type", 29 | "operator":"==", 30 | "value":"page" 31 | } 32 | ] 33 | ], 34 | "menu_order":10, 35 | "position":"normal", 36 | "style":"default", 37 | "label_placement":"top", 38 | "instruction_placement":"label", 39 | "hide_on_screen":[ 40 | "the_content", 41 | "excerpt" 42 | ] 43 | } 44 | ] -------------------------------------------------------------------------------- /includes/class-acfmod-section.php: -------------------------------------------------------------------------------- 1 | open; 41 | } 42 | 43 | /** 44 | * Get Column Width 45 | * 46 | * @param string $col Which column. 47 | * @return mixed Column width 48 | */ 49 | public function get_col_width( $col = null ) { 50 | if ( null === $col ) { 51 | $col = $this->current_col; 52 | } 53 | 54 | if ( isset( $this->{'col' . $col . 'width'} ) ) { 55 | return $this->{'col' . $col . 'width'}; 56 | } 57 | 58 | return false; 59 | } 60 | 61 | /** 62 | * Set Column Width 63 | * 64 | * @param string $col Which column. 65 | * @param int $width Width of Column. 66 | */ 67 | public function set_col_width( $col, $width ) { 68 | $this->{'col' . $col . 'width'} = $width; 69 | } 70 | 71 | /** 72 | * Set Class of Section 73 | * 74 | * @param string $class Class Name. 75 | */ 76 | public function set_class( $class ) { 77 | $this->class = $class; 78 | } 79 | 80 | /** 81 | * Get Section Class 82 | * 83 | * @return string Class Name 84 | */ 85 | public function get_class() { 86 | if ( $this->class ) { 87 | $this->class = ' ' . trim( $this->class ); 88 | } 89 | return $this->class; 90 | } 91 | 92 | /** 93 | * Get Section ID 94 | * 95 | * @return string Section ID 96 | */ 97 | function get_id() { 98 | global $acfmod_current_section; 99 | return $acfmod_current_section; 100 | } 101 | 102 | /** 103 | * Open Section 104 | * 105 | * @return string HTML Markup to open section 106 | */ 107 | public function open() { 108 | global $acfmod_sections, $acfmod_current_section; 109 | 110 | $markup = ''; 111 | $section_open = false; 112 | 113 | if ( isset( $acfmod_sections[ $acfmod_current_section ] ) ) { 114 | $acfmod_sections[ $acfmod_current_section ]->current_col++; 115 | $col_width = $acfmod_sections[ $acfmod_current_section ]->get_col_width(); 116 | $section_open = $acfmod_sections[ $acfmod_current_section ]->is_open(); 117 | 118 | $id = $acfmod_sections[ $acfmod_current_section ]->get_id(); 119 | 120 | $this->class .= ' section-column'; 121 | $this->class .= ' section-' . $id; 122 | 123 | $markup .= ''; 128 | } 129 | 130 | $markup .= "\r\n" . '
'; 131 | 132 | if ( ! $section_open ) { 133 | if ( function_exists( 'genesis_structural_wrap' ) ) { 134 | $markup .= genesis_structural_wrap( 'modular-section', 'open', false ); 135 | } 136 | } 137 | 138 | $this->open = true; 139 | 140 | return $markup; 141 | } 142 | 143 | /** 144 | * Close Section 145 | * 146 | * @return string HTML Markup to close section 147 | */ 148 | public function close() { 149 | global $acfmod_sections, $acfmod_current_section; 150 | 151 | $markup = ''; 152 | 153 | if ( isset( $acfmod_sections[ $acfmod_current_section ] ) ) { 154 | $section_open = $acfmod_sections[ $acfmod_current_section ]->is_open(); 155 | } 156 | 157 | if ( ! $section_open ) { 158 | if ( function_exists( 'genesis_structural_wrap' ) ) { 159 | $markup = genesis_structural_wrap( 'modular-section', 'close', false ); 160 | } 161 | } 162 | 163 | $markup .= '
' . "\r\n"; 164 | 165 | $this->open = false; 166 | 167 | return $markup; 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /includes/helpers.php: -------------------------------------------------------------------------------- 1 | false, 38 | ); 39 | 40 | if ( empty( $post_id ) ) { 41 | if ( $doing_ajax ) { 42 | wp_send_json( $response ); 43 | } 44 | return false; 45 | } 46 | 47 | $the_post = get_post( $post_id ); 48 | 49 | if ( ! $doing_ajax ) { 50 | if ( $filtered ) { 51 | return apply_filters( 'the_content', $the_post->post_content ); 52 | } 53 | return $the_post->post_content; 54 | } 55 | 56 | $response['post_content'] = apply_filters( 'the_content', $the_post->post_content ); 57 | $response['success'] = true; 58 | 59 | wp_send_json( $response ); 60 | } 61 | 62 | /** 63 | * JS Variables for AJAX Call 64 | * 65 | * @return array JS Variables 66 | */ 67 | function acfmod_js_vars() { 68 | return array( 69 | 'ajax_url' => admin_url( 'admin-ajax.php' ), 70 | ); 71 | } 72 | 73 | /** 74 | * Get Post Image 75 | * 76 | * @param int $post_id The Post Id. 77 | * @param boolean $default Use Default. 78 | * @return array Post Image 79 | */ 80 | function acfmod_get_post_image( $post_id = null, $default = false ) { 81 | if ( empty( $post_id ) ) { 82 | $post_id = get_the_ID(); 83 | } 84 | 85 | $image = get_field( '_acfmod_image', $post_id ); 86 | 87 | if ( ! $image && $default ) { 88 | return $default; 89 | } 90 | 91 | if ( ! $image ) { 92 | $image = get_field( '_acfmod_default_post_image', 'option' ); 93 | } 94 | 95 | return $image; 96 | } 97 | -------------------------------------------------------------------------------- /includes/init.php: -------------------------------------------------------------------------------- 1 | 'acfmod_modules_group', 26 | 'title' => 'Content Modules', 27 | 'fields' => array( 28 | array( 29 | 'key' => 'acf_modules_field', 30 | 'label' => 'Modules', 31 | 'name' => '_acfmod_modules', 32 | 'type' => 'flexible_content', 33 | 'instructions' => 'Create many different types of content by selecting the module and filling in the fields.', 34 | 'required' => 0, 35 | 'conditional_logic' => 0, 36 | 'wrapper' => array( 37 | 'width' => '', 38 | 'class' => '', 39 | 'id' => '', 40 | ), 41 | 'button_label' => 'Add Module', 42 | 'min' => 0, 43 | 'max' => '', 44 | 'layouts' => $layouts, 45 | ), 46 | ), 47 | 'location' => array( 48 | array( 49 | array( 50 | 'param' => 'post_type', 51 | 'operator' => '==', 52 | 'value' => 'page', 53 | ), 54 | ), 55 | ), 56 | 'menu_order' => 1, 57 | 'position' => 'normal', 58 | 'style' => 'default', 59 | 'label_placement' => 'top', 60 | 'instruction_placement' => 'label', 61 | 'hide_on_screen' => array( 62 | 0 => 'the_content', 63 | 1 => 'excerpt', 64 | ), 65 | )); 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /modules/call-to-action.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "key":"group_543c1c5fdde54", 4 | "title":"Content Modules", 5 | "fields":[ 6 | { 7 | "key":"field_543d7bc015b3d", 8 | "label":"Modules", 9 | "name":"_acfmod_modules", 10 | "type":"flexible_content", 11 | "instructions":"Create many different types of content by selecting the module and filling in the fields.", 12 | "required":0, 13 | "conditional_logic":0, 14 | "wrapper":{ 15 | "width":"", 16 | "class":"", 17 | "id":"" 18 | }, 19 | "button_label":"Add Module", 20 | "min":0, 21 | "max":"", 22 | "layouts":[ 23 | { 24 | "key":"5449d44b4e176", 25 | "name":"call_to_action", 26 | "label":"Call to Action", 27 | "display":"row", 28 | "sub_fields":[ 29 | { 30 | "key":"field_544ea6d6b0b93", 31 | "label":"Alignment", 32 | "name":"alignment", 33 | "type":"radio", 34 | "instructions":"", 35 | "required":0, 36 | "conditional_logic":0, 37 | "wrapper":{ 38 | "width":"", 39 | "class":"", 40 | "id":"" 41 | }, 42 | "choices":{ 43 | "left":"Left", 44 | "center":"Center (default)", 45 | "right":"Right" 46 | }, 47 | "other_choice":0, 48 | "save_other_choice":0, 49 | "default_value":"center", 50 | "layout":"horizontal" 51 | }, 52 | { 53 | "key":"field_5449d46b4e177", 54 | "label":"Heading", 55 | "name":"heading", 56 | "type":"text", 57 | "instructions":"", 58 | "required":0, 59 | "conditional_logic":0, 60 | "wrapper":{ 61 | "width":"", 62 | "class":"", 63 | "id":"" 64 | }, 65 | "default_value":"", 66 | "placeholder":"", 67 | "prepend":"", 68 | "append":"", 69 | "maxlength":"", 70 | "readonly":0, 71 | "disabled":0 72 | }, 73 | { 74 | "key":"field_5449d48a4e178", 75 | "label":"Text", 76 | "name":"text", 77 | "type":"wysiwyg", 78 | "instructions":"", 79 | "required":0, 80 | "conditional_logic":0, 81 | "wrapper":{ 82 | "width":"", 83 | "class":"", 84 | "id":"" 85 | }, 86 | "default_value":"", 87 | "tabs":"all", 88 | "toolbar":"basic", 89 | "media_upload":1 90 | }, 91 | { 92 | "key":"field_5449d4ad4e179", 93 | "label":"Button Text", 94 | "name":"button_text", 95 | "type":"text", 96 | "instructions":"", 97 | "required":0, 98 | "conditional_logic":0, 99 | "wrapper":{ 100 | "width":"", 101 | "class":"", 102 | "id":"" 103 | }, 104 | "default_value":"", 105 | "placeholder":"", 106 | "prepend":"", 107 | "append":"", 108 | "maxlength":"", 109 | "readonly":0, 110 | "disabled":0 111 | }, 112 | { 113 | "key":"field_5449d4bc4e17a", 114 | "label":"CTA URL", 115 | "name":"cta_url", 116 | "type":"url", 117 | "instructions":"", 118 | "required":0, 119 | "conditional_logic":0, 120 | "wrapper":{ 121 | "width":"", 122 | "class":"", 123 | "id":"" 124 | }, 125 | "default_value":"", 126 | "placeholder":"" 127 | }, 128 | { 129 | "key":"field_5449d4d24e17b", 130 | "label":"Background Color", 131 | "name":"background_color", 132 | "type":"color_picker", 133 | "instructions":"Suggested Hex codes are: #3BB6E1 (blue), #BBD152 (green), and #EC7326 (orange)", 134 | "required":0, 135 | "conditional_logic":0, 136 | "wrapper":{ 137 | "width":"", 138 | "class":"", 139 | "id":"" 140 | }, 141 | "default_value":"" 142 | }, 143 | { 144 | "key":"field_5449d4f14e17c", 145 | "label":"Text Color", 146 | "name":"text_color", 147 | "type":"color_picker", 148 | "instructions":"", 149 | "required":0, 150 | "conditional_logic":0, 151 | "wrapper":{ 152 | "width":"", 153 | "class":"", 154 | "id":"" 155 | }, 156 | "default_value":"#333333" 157 | }, 158 | { 159 | "key":"field_5449d5054e17d", 160 | "label":"Button Color", 161 | "name":"button_color", 162 | "type":"color_picker", 163 | "instructions":"", 164 | "required":0, 165 | "conditional_logic":0, 166 | "wrapper":{ 167 | "width":"", 168 | "class":"", 169 | "id":"" 170 | }, 171 | "default_value":"#FCAC44" 172 | }, 173 | { 174 | "key":"field_5459b5ecee4aa", 175 | "label":"Module Styles", 176 | "name":"module_styles", 177 | "type":"text", 178 | "instructions":"Apply CSS directly to the module container element. Use to tweak positioning\/layouts to perfection.", 179 | "required":0, 180 | "conditional_logic":0, 181 | "wrapper":{ 182 | "width":"", 183 | "class":"", 184 | "id":"" 185 | }, 186 | "default_value":"", 187 | "placeholder":"", 188 | "prepend":"", 189 | "append":"", 190 | "maxlength":"", 191 | "readonly":0, 192 | "disabled":0 193 | } 194 | ], 195 | "min":"", 196 | "max":"" 197 | } 198 | ] 199 | } 200 | ], 201 | "location":[ 202 | [ 203 | { 204 | "param":"post_type", 205 | "operator":"==", 206 | "value":"page" 207 | }, 208 | { 209 | "param":"page_template", 210 | "operator":"!=", 211 | "value":"page_blog.php" 212 | } 213 | ] 214 | ], 215 | "menu_order":10, 216 | "position":"normal", 217 | "style":"default", 218 | "label_placement":"top", 219 | "instruction_placement":"label", 220 | "hide_on_screen":[ 221 | "the_content", 222 | "excerpt" 223 | ] 224 | } 225 | ] 226 | -------------------------------------------------------------------------------- /modules/call-to-action.php: -------------------------------------------------------------------------------- 1 | '5449d44b4e176', 19 | 'name' => 'call_to_action', 20 | 'label' => 'Call to Action', 21 | 'display' => 'row', 22 | 'sub_fields' => array( 23 | array( 24 | 'key' => 'field_544ea6d6b0b93', 25 | 'label' => 'Alignment', 26 | 'name' => 'alignment', 27 | 'type' => 'radio', 28 | 'instructions' => '', 29 | 'required' => 0, 30 | 'conditional_logic' => 0, 31 | 'wrapper' => array( 32 | 'width' => '', 33 | 'class' => '', 34 | 'id' => '', 35 | ), 36 | 'choices' => array( 37 | 'left' => 'Left', 38 | 'center' => 'Center (default)', 39 | 'right' => 'Right', 40 | ), 41 | 'other_choice' => 0, 42 | 'save_other_choice' => 0, 43 | 'default_value' => 'center', 44 | 'layout' => 'horizontal', 45 | ), 46 | array( 47 | 'key' => 'field_5449d46b4e177', 48 | 'label' => 'Heading', 49 | 'name' => 'heading', 50 | 'type' => 'text', 51 | 'instructions' => '', 52 | 'required' => 0, 53 | 'conditional_logic' => 0, 54 | 'wrapper' => array( 55 | 'width' => '', 56 | 'class' => '', 57 | 'id' => '', 58 | ), 59 | 'default_value' => '', 60 | 'placeholder' => '', 61 | 'prepend' => '', 62 | 'append' => '', 63 | 'maxlength' => '', 64 | 'readonly' => 0, 65 | 'disabled' => 0, 66 | ), 67 | array( 68 | 'key' => 'field_5449d48a4e178', 69 | 'label' => 'Text', 70 | 'name' => 'text', 71 | 'type' => 'wysiwyg', 72 | 'instructions' => '', 73 | 'required' => 0, 74 | 'conditional_logic' => 0, 75 | 'wrapper' => array( 76 | 'width' => '', 77 | 'class' => '', 78 | 'id' => '', 79 | ), 80 | 'default_value' => '', 81 | 'tabs' => 'all', 82 | 'toolbar' => 'basic', 83 | 'media_upload' => 1, 84 | ), 85 | array( 86 | 'key' => 'field_5449d4ad4e179', 87 | 'label' => 'Button Text', 88 | 'name' => 'button_text', 89 | 'type' => 'text', 90 | 'instructions' => '', 91 | 'required' => 0, 92 | 'conditional_logic' => 0, 93 | 'wrapper' => array( 94 | 'width' => '', 95 | 'class' => '', 96 | 'id' => '', 97 | ), 98 | 'default_value' => '', 99 | 'placeholder' => '', 100 | 'prepend' => '', 101 | 'append' => '', 102 | 'maxlength' => '', 103 | 'readonly' => 0, 104 | 'disabled' => 0, 105 | ), 106 | array( 107 | 'key' => 'field_5449d4bc4e17a', 108 | 'label' => 'CTA URL', 109 | 'name' => 'cta_url', 110 | 'type' => 'url', 111 | 'instructions' => '', 112 | 'required' => 0, 113 | 'conditional_logic' => 0, 114 | 'wrapper' => array( 115 | 'width' => '', 116 | 'class' => '', 117 | 'id' => '', 118 | ), 119 | 'default_value' => '', 120 | 'placeholder' => '', 121 | ), 122 | array( 123 | 'key' => 'field_5449d4d24e17b', 124 | 'label' => 'Background Color', 125 | 'name' => 'background_color', 126 | 'type' => 'color_picker', 127 | 'instructions' => '', 128 | 'required' => 0, 129 | 'conditional_logic' => 0, 130 | 'wrapper' => array( 131 | 'width' => '', 132 | 'class' => '', 133 | 'id' => '', 134 | ), 135 | 'default_value' => '', 136 | ), 137 | array( 138 | 'key' => 'field_5449d4f14e17c', 139 | 'label' => 'Text Color', 140 | 'name' => 'text_color', 141 | 'type' => 'color_picker', 142 | 'instructions' => '', 143 | 'required' => 0, 144 | 'conditional_logic' => 0, 145 | 'wrapper' => array( 146 | 'width' => '', 147 | 'class' => '', 148 | 'id' => '', 149 | ), 150 | 'default_value' => '#333333', 151 | ), 152 | array( 153 | 'key' => 'field_5449d5054e17d', 154 | 'label' => 'Button Color', 155 | 'name' => 'button_color', 156 | 'type' => 'color_picker', 157 | 'instructions' => '', 158 | 'required' => 0, 159 | 'conditional_logic' => 0, 160 | 'wrapper' => array( 161 | 'width' => '', 162 | 'class' => '', 163 | 'id' => '', 164 | ), 165 | 'default_value' => '#3BB6E1', 166 | ), 167 | array( 168 | 'key' => 'field_5459b5ecee4aa', 169 | 'label' => 'Module Styles', 170 | 'name' => 'module_styles', 171 | 'type' => 'text', 172 | 'instructions' => 'Apply CSS directly to the module container element. Use to tweak positioning/layouts to perfection.', 173 | 'required' => 0, 174 | 'conditional_logic' => 0, 175 | 'wrapper' => array( 176 | 'width' => '', 177 | 'class' => '', 178 | 'id' => '', 179 | ), 180 | 'default_value' => '', 181 | 'placeholder' => '', 182 | 'prepend' => '', 183 | 'append' => '', 184 | 'maxlength' => '', 185 | 'readonly' => 0, 186 | 'disabled' => 0, 187 | ), 188 | ), 189 | 'min' => '', 190 | 'max' => '', 191 | ); 192 | 193 | return $layouts; 194 | } 195 | 196 | global $cta_modules; 197 | $cta_modules = 0; 198 | 199 | add_filter( 'acfmod/modules/call_to_action', 'acfmod_modules_call_to_action' ); 200 | 201 | /** 202 | * Call to Action Module 203 | * 204 | * @return html Module Output 205 | */ 206 | function acfmod_modules_call_to_action() { 207 | global $cta_modules; 208 | 209 | $cta_modules++; 210 | 211 | $heading = trim( get_sub_field( 'heading' ) ); 212 | $text = trim( get_sub_field( 'text' ) ); 213 | $button = trim( get_sub_field( 'button_text' ) ); 214 | $alignment = get_sub_field( 'alignment' ); 215 | 216 | $url = get_sub_field( 'cta_url' ); 217 | $background = get_sub_field( 'background_color' ); 218 | $foreground = get_sub_field( 'text_color' ); 219 | $button_color = get_sub_field( 'button_color' ); 220 | 221 | $output = ''; 247 | 248 | $output .= '
'; 249 | 250 | if ( $heading ) { 251 | $output .= '

' . $heading . '

'; 252 | } 253 | if ( $text ) { 254 | $output .= '
' . $text . '
'; 255 | } 256 | if ( $button && $url ) { 257 | $output .= '' . $button . ''; 258 | } 259 | 260 | $output .= '
'; 261 | 262 | return $output; 263 | } 264 | -------------------------------------------------------------------------------- /modules/content.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "key":"group_543c1c5fdde54", 4 | "title":"Content Modules", 5 | "fields":[ 6 | { 7 | "key":"field_543d7bc015b3d", 8 | "label":"Modules", 9 | "name":"_acfmod_modules", 10 | "type":"flexible_content", 11 | "instructions":"Create many different types of content by selecting the module and filling in the fields.", 12 | "required":0, 13 | "conditional_logic":0, 14 | "wrapper":{ 15 | "width":"", 16 | "class":"", 17 | "id":"" 18 | }, 19 | "button_label":"Add Module", 20 | "min":0, 21 | "max":"", 22 | "layouts":[ 23 | { 24 | "key":"543eb4f3a8e09", 25 | "name":"simple_content", 26 | "label":"Simple Content", 27 | "display":"row", 28 | "sub_fields":[ 29 | { 30 | "key":"field_543eb52ccb62f", 31 | "label":"Simple Content", 32 | "name":"content", 33 | "type":"wysiwyg", 34 | "instructions":"", 35 | "required":0, 36 | "conditional_logic":0, 37 | "wrapper":{ 38 | "width":"", 39 | "class":"", 40 | "id":"" 41 | }, 42 | "default_value":"", 43 | "tabs":"all", 44 | "toolbar":"full", 45 | "media_upload":1 46 | }, 47 | { 48 | "key": "field_55686bd79d811", 49 | "label": "Load Post Content", 50 | "name": "load_post_content", 51 | "type": "true_false", 52 | "instructions": "", 53 | "required": 0, 54 | "conditional_logic": 0, 55 | "wrapper": { 56 | "width": "", 57 | "class": "", 58 | "id": "" 59 | }, 60 | "message": "Import content from current post_content field.", 61 | "default_value": 0 62 | }, 63 | { 64 | "key": "field_55686c1d9d812", 65 | "label": "Delete Post Content", 66 | "name": "delete_post_content", 67 | "type": "true_false", 68 | "instructions": "", 69 | "required": 0, 70 | "conditional_logic": [ 71 | [ 72 | { 73 | "field": "field_55686bd79d811", 74 | "operator": "==", 75 | "value": "1" 76 | } 77 | ] 78 | ], 79 | "wrapper": { 80 | "width": "", 81 | "class": "", 82 | "id": "" 83 | }, 84 | "message": "Delete post content after importing.", 85 | "default_value": 0 86 | }, 87 | { 88 | "key":"field_5459b579ee4a6", 89 | "label":"Module Styles", 90 | "name":"module_styles", 91 | "type":"text", 92 | "instructions":"Apply CSS directly to the module container element. Use to tweak positioning\/layouts to perfection.", 93 | "required":0, 94 | "conditional_logic":0, 95 | "wrapper":{ 96 | "width":"", 97 | "class":"", 98 | "id":"" 99 | }, 100 | "default_value":"", 101 | "placeholder":"", 102 | "prepend":"", 103 | "append":"", 104 | "maxlength":"", 105 | "readonly":0, 106 | "disabled":0 107 | } 108 | ], 109 | "min":"", 110 | "max":"" 111 | } 112 | ] 113 | } 114 | ], 115 | "location":[ 116 | [ 117 | { 118 | "param":"post_type", 119 | "operator":"==", 120 | "value":"page" 121 | }, 122 | { 123 | "param":"page_template", 124 | "operator":"!=", 125 | "value":"page_blog.php" 126 | } 127 | ] 128 | ], 129 | "menu_order":10, 130 | "position":"normal", 131 | "style":"default", 132 | "label_placement":"top", 133 | "instruction_placement":"label", 134 | "hide_on_screen":[ 135 | "the_content", 136 | "excerpt" 137 | ] 138 | } 139 | ] 140 | -------------------------------------------------------------------------------- /modules/content.php: -------------------------------------------------------------------------------- 1 | 'field_543eb52ccb62f', 21 | 'label' => 'Simple Content', 22 | 'name' => 'content', 23 | 'type' => 'wysiwyg', 24 | 'instructions' => '', 25 | 'required' => 0, 26 | 'conditional_logic' => 0, 27 | 'wrapper' => array( 28 | 'width' => '', 29 | 'class' => '', 30 | 'id' => '', 31 | ), 32 | 'default_value' => '', 33 | 'tabs' => 'all', 34 | 'toolbar' => 'full', 35 | 'media_upload' => 1, 36 | ), 37 | ); 38 | 39 | $post_id = isset( $_GET['post'] ) ? absint( sanitize_text_field( $_GET['post'] ) ) : ''; 40 | 41 | if ( ! empty( $post_id ) ) { 42 | 43 | if ( is_admin() ) { 44 | wp_register_script( 'acfmod-simple-content-admin', ACFMOD_URI . 'assets/js/simple-content.admin.js', array( 'jquery' ) ); 45 | wp_localize_script( 'acfmod-simple-content-admin', 'acfmod_vars', acfmod_js_vars() ); 46 | wp_enqueue_script( 'acfmod-simple-content-admin' ); 47 | } 48 | 49 | if ( acfmod_get_post_content( $post_id, false ) ) { 50 | $subfields[] = array( 51 | 'key' => 'field_55686bd79d811', 52 | 'label' => 'Load Post Content', 53 | 'name' => 'load_post_content', 54 | 'type' => 'true_false', 55 | 'instructions' => '', 56 | 'required' => 0, 57 | 'conditional_logic' => 0, 58 | 'wrapper' => array( 59 | 'width' => '', 60 | 'class' => '', 61 | 'id' => '', 62 | ), 63 | 'message' => 'Import content from current post_content field.', 64 | 'default_value' => 0, 65 | ); 66 | 67 | $subfields[] = array( 68 | 'key' => 'field_55686c1d9d812', 69 | 'label' => 'Delete Post Content', 70 | 'name' => 'delete_post_content', 71 | 'type' => 'true_false', 72 | 'instructions' => '', 73 | 'required' => 0, 74 | 'conditional_logic' => array( 75 | array( 76 | array( 77 | 'field' => 'field_55686bd79d811', 78 | 'operator' => '==', 79 | 'value' => '1', 80 | ), 81 | ), 82 | ), 83 | 'wrapper' => array( 84 | 'width' => '', 85 | 'class' => '', 86 | 'id' => '', 87 | ), 88 | 'message' => 'Delete original post content after saving.', 89 | 'default_value' => 0, 90 | ); 91 | } 92 | } 93 | 94 | $subfields[] = array( 95 | 'key' => 'field_5459b579ee4a6', 96 | 'label' => 'Module Styles', 97 | 'name' => 'module_styles', 98 | 'type' => 'text', 99 | 'instructions' => 'Apply CSS directly to the module container element. Use to tweak positioning/layouts to perfection.', 100 | 'required' => 0, 101 | 'conditional_logic' => 0, 102 | 'wrapper' => array( 103 | 'width' => '', 104 | 'class' => '', 105 | 'id' => '', 106 | ), 107 | 'default_value' => '', 108 | 'placeholder' => '', 109 | 'prepend' => '', 110 | 'append' => '', 111 | 'maxlength' => '', 112 | 'readonly' => 0, 113 | 'disabled' => 0, 114 | ); 115 | 116 | $layouts[] = array( 117 | 'key' => '543eb4f3a8e09', 118 | 'name' => 'simple_content', 119 | 'label' => 'Simple Content', 120 | 'display' => 'row', 121 | 'sub_fields' => $subfields, 122 | 'min' => '', 123 | 'max' => '', 124 | ); 125 | 126 | return $layouts; 127 | } 128 | 129 | add_filter( 'acfmod/modules/content', 'acfmod_modules_content' ); 130 | add_filter( 'acfmod/modules/simple_content', 'acfmod_modules_content' ); 131 | 132 | /** 133 | * Simple Content Module 134 | * 135 | * @return html Module Output 136 | */ 137 | function acfmod_modules_content() { 138 | $output = get_sub_field( 'content' ); 139 | return $output; 140 | } 141 | 142 | add_action( 'acf/save_post', 'acfmod_simple_content_save_post', 20 ); 143 | 144 | /** 145 | * This may delete the post content if checkbox is selected 146 | * 147 | * @param int $post_id The Post ID. 148 | */ 149 | function acfmod_simple_content_save_post( $post_id ) { 150 | 151 | // bail early if no ACF data. 152 | if ( empty( $_POST['acf'] ) ) { 153 | return; 154 | } 155 | 156 | // array of field values. 157 | $fields = wp_unslash( $_POST['acf'] ); 158 | 159 | if ( ! isset( $fields['acf_modules_field'] ) && is_array( $fields['acf_modules_field'] ) ) { 160 | return; 161 | } 162 | 163 | // This may change in the future... yikes... 164 | $delete_content_key = 'field_55686c1d9d812'; 165 | 166 | // assume we aren't deleting content. 167 | $do_delete_content = false; 168 | 169 | // get modules values. 170 | foreach ( $fields['acf_modules_field'] as $module ) { 171 | if ( isset( $module[ $delete_content_key ] ) ) { 172 | if ( $module[ $delete_content_key ] ) { 173 | $do_delete_content = true; 174 | } 175 | } 176 | } 177 | 178 | // don't store the values for delete and load content fields. 179 | // @TODO: not sure how to do that just yet. 180 | // bail early if we're not deleting the content. 181 | if ( ! $do_delete_content ) { 182 | return; 183 | } 184 | 185 | // clear the post content. 186 | remove_action( 'acf/save_post', 'acfmod_simple_content_save_post', 20 ); 187 | 188 | $delete_content = array( 189 | 'ID' => $post_id, 190 | 'post_content' => '', 191 | ); 192 | 193 | wp_update_post( $delete_content ); 194 | 195 | add_action( 'acf/save_post', 'acfmod_simple_content_save_post', 20 ); 196 | } 197 | -------------------------------------------------------------------------------- /modules/counters.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "key":"group_543c1c5fdde54", 4 | "title":"Content Modules", 5 | "fields":[ 6 | { 7 | "key":"field_543d7bc015b3d", 8 | "label":"Modules", 9 | "name":"_acfmod_modules", 10 | "type":"flexible_content", 11 | "instructions":"Create many different types of content by selecting the module and filling in the fields.", 12 | "required":0, 13 | "conditional_logic":0, 14 | "wrapper":{ 15 | "width":"", 16 | "class":"", 17 | "id":"" 18 | }, 19 | "button_label":"Add Module", 20 | "min":0, 21 | "max":"", 22 | "layouts":[ 23 | { 24 | "key":"54490f40a6662", 25 | "name":"counters", 26 | "label":"Stats\/Counters", 27 | "display":"row", 28 | "sub_fields":[ 29 | { 30 | "key":"field_54490f59a6663", 31 | "label":"Style", 32 | "name":"style", 33 | "type":"radio", 34 | "instructions":"", 35 | "required":1, 36 | "conditional_logic":0, 37 | "wrapper":{ 38 | "width":"", 39 | "class":"", 40 | "id":"" 41 | }, 42 | "choices":{ 43 | "plain":"Plain", 44 | "bar":"Bar", 45 | "circle":"Circle" 46 | }, 47 | "other_choice":0, 48 | "save_other_choice":0, 49 | "default_value":"plain", 50 | "layout":"horizontal" 51 | }, 52 | { 53 | "key":"field_54523d7aef7eb", 54 | "label":"Disable Bar Background", 55 | "name":"disable_bar_background", 56 | "type":"true_false", 57 | "instructions":"", 58 | "required":0, 59 | "conditional_logic":[ 60 | [ 61 | { 62 | "field":"field_54490f59a6663", 63 | "operator":"==", 64 | "value":"bar" 65 | } 66 | ] 67 | ], 68 | "wrapper":{ 69 | "width":"", 70 | "class":"", 71 | "id":"" 72 | }, 73 | "message":"", 74 | "default_value":0 75 | }, 76 | { 77 | "key":"field_54490fb5a6664", 78 | "label":"Stats", 79 | "name":"stats", 80 | "type":"repeater", 81 | "instructions":"", 82 | "required":0, 83 | "conditional_logic":0, 84 | "wrapper":{ 85 | "width":"", 86 | "class":"", 87 | "id":"" 88 | }, 89 | "min":1, 90 | "max":"", 91 | "layout":"row", 92 | "button_label":"Add Stat", 93 | "sub_fields":[ 94 | { 95 | "key":"field_54490ff1a6665", 96 | "label":"Value", 97 | "name":"value", 98 | "type":"text", 99 | "instructions":"", 100 | "required":0, 101 | "conditional_logic":0, 102 | "wrapper":{ 103 | "width":"", 104 | "class":"", 105 | "id":"" 106 | }, 107 | "default_value":"", 108 | "placeholder":"", 109 | "prepend":"", 110 | "append":"", 111 | "maxlength":"", 112 | "readonly":0, 113 | "disabled":0 114 | }, 115 | { 116 | "key":"field_5449105ca6666", 117 | "label":"Label", 118 | "name":"label", 119 | "type":"text", 120 | "instructions":"", 121 | "required":0, 122 | "conditional_logic":0, 123 | "wrapper":{ 124 | "width":"", 125 | "class":"", 126 | "id":"" 127 | }, 128 | "default_value":"", 129 | "placeholder":"", 130 | "prepend":"", 131 | "append":"", 132 | "maxlength":"", 133 | "readonly":0, 134 | "disabled":0 135 | }, 136 | { 137 | "key":"field_54491082a6667", 138 | "label":"Color", 139 | "name":"color", 140 | "type":"color_picker", 141 | "instructions":"", 142 | "required":0, 143 | "conditional_logic":0, 144 | "wrapper":{ 145 | "width":"", 146 | "class":"", 147 | "id":"" 148 | }, 149 | "default_value":"#333333" 150 | }, 151 | { 152 | "key":"field_5450fbbd85fa7", 153 | "label":"Disable Text Color", 154 | "name":"disable_text_color", 155 | "type":"true_false", 156 | "instructions":"", 157 | "required":0, 158 | "conditional_logic":[ 159 | [ 160 | { 161 | "field":"field_54490f59a6663", 162 | "operator":"==", 163 | "value":"circle" 164 | } 165 | ] 166 | ], 167 | "wrapper":{ 168 | "width":"", 169 | "class":"", 170 | "id":"" 171 | }, 172 | "message":"", 173 | "default_value":1 174 | } 175 | ] 176 | }, 177 | { 178 | "key":"field_544ea678eee76", 179 | "label":"Direction", 180 | "name":"direction", 181 | "type":"radio", 182 | "instructions":"", 183 | "required":0, 184 | "conditional_logic":[ 185 | [ 186 | { 187 | "field":"field_54490f59a6663", 188 | "operator":"==", 189 | "value":"bar" 190 | } 191 | ] 192 | ], 193 | "wrapper":{ 194 | "width":"", 195 | "class":"", 196 | "id":"" 197 | }, 198 | "choices":{ 199 | "right":"Right (default)", 200 | "left":"Left" 201 | }, 202 | "other_choice":0, 203 | "save_other_choice":0, 204 | "default_value":"right", 205 | "layout":"horizontal" 206 | }, 207 | { 208 | "key":"field_544e64202d6b3", 209 | "label":"Style Restrictions", 210 | "name":"", 211 | "type":"message", 212 | "instructions":"", 213 | "required":0, 214 | "conditional_logic":[ 215 | [ 216 | { 217 | "field":"field_54490f59a6663", 218 | "operator":"==", 219 | "value":"bar" 220 | } 221 | ], 222 | [ 223 | { 224 | "field":"field_54490f59a6663", 225 | "operator":"==", 226 | "value":"circle" 227 | } 228 | ] 229 | ], 230 | "wrapper":{ 231 | "width":"", 232 | "class":"", 233 | "id":"" 234 | }, 235 | "message":"Note: This field style only supports percentage based values (0-100). Percent sign (%) is optional.", 236 | "esc_html":0 237 | }, 238 | { 239 | "key":"field_5459b5e0ee4a9", 240 | "label":"Module Styles", 241 | "name":"module_styles", 242 | "type":"text", 243 | "instructions":"Apply CSS directly to the module container element. Use to tweak positioning\/layouts to perfection.", 244 | "required":0, 245 | "conditional_logic":0, 246 | "wrapper":{ 247 | "width":"", 248 | "class":"", 249 | "id":"" 250 | }, 251 | "default_value":"", 252 | "placeholder":"", 253 | "prepend":"", 254 | "append":"", 255 | "maxlength":"", 256 | "readonly":0, 257 | "disabled":0 258 | } 259 | ], 260 | "min":"", 261 | "max":"" 262 | } 263 | ] 264 | } 265 | ], 266 | "location":[ 267 | [ 268 | { 269 | "param":"post_type", 270 | "operator":"==", 271 | "value":"page" 272 | } 273 | ] 274 | ], 275 | "menu_order":10, 276 | "position":"normal", 277 | "style":"default", 278 | "label_placement":"top", 279 | "instruction_placement":"label", 280 | "hide_on_screen":[ 281 | "the_content", 282 | "excerpt" 283 | ] 284 | } 285 | ] 286 | -------------------------------------------------------------------------------- /modules/counters.php: -------------------------------------------------------------------------------- 1 | '54490f40a6662', 19 | 'name' => 'counters', 20 | 'label' => 'Stats/Counters', 21 | 'display' => 'row', 22 | 'sub_fields' => array( 23 | array( 24 | 'key' => 'field_54490f59a6663', 25 | 'label' => 'Style', 26 | 'name' => 'style', 27 | 'type' => 'radio', 28 | 'instructions' => '', 29 | 'required' => 1, 30 | 'conditional_logic' => 0, 31 | 'wrapper' => array( 32 | 'width' => '', 33 | 'class' => '', 34 | 'id' => '', 35 | ), 36 | 'choices' => array( 37 | 'plain' => 'Plain', 38 | 'bar' => 'Bar', 39 | 'circle' => 'Circle', 40 | ), 41 | 'other_choice' => 0, 42 | 'save_other_choice' => 0, 43 | 'default_value' => 'plain', 44 | 'layout' => 'horizontal', 45 | ), 46 | array( 47 | 'key' => 'field_54523d7aef7eb', 48 | 'label' => 'Disable Bar Background', 49 | 'name' => 'disable_bar_background', 50 | 'type' => 'true_false', 51 | 'instructions' => '', 52 | 'required' => 0, 53 | 'conditional_logic' => array( 54 | array( 55 | array( 56 | 'field' => 'field_54490f59a6663', 57 | 'operator' => '==', 58 | 'value' => 'bar', 59 | ), 60 | ), 61 | ), 62 | 'wrapper' => array( 63 | 'width' => '', 64 | 'class' => '', 65 | 'id' => '', 66 | ), 67 | 'message' => '', 68 | 'default_value' => 0, 69 | ), 70 | array( 71 | 'key' => 'field_54490fb5a6664', 72 | 'label' => 'Stats', 73 | 'name' => 'stats', 74 | 'type' => 'repeater', 75 | 'instructions' => '', 76 | 'required' => 0, 77 | 'conditional_logic' => 0, 78 | 'wrapper' => array( 79 | 'width' => '', 80 | 'class' => '', 81 | 'id' => '', 82 | ), 83 | 'min' => 1, 84 | 'max' => '', 85 | 'layout' => 'row', 86 | 'button_label' => 'Add Stat', 87 | 'sub_fields' => array( 88 | array( 89 | 'key' => 'field_54490ff1a6665', 90 | 'label' => 'Value', 91 | 'name' => 'value', 92 | 'type' => 'text', 93 | 'instructions' => '', 94 | 'required' => 0, 95 | 'conditional_logic' => 0, 96 | 'wrapper' => array( 97 | 'width' => '', 98 | 'class' => '', 99 | 'id' => '', 100 | ), 101 | 'default_value' => '', 102 | 'placeholder' => '', 103 | 'prepend' => '', 104 | 'append' => '', 105 | 'maxlength' => '', 106 | 'readonly' => 0, 107 | 'disabled' => 0, 108 | ), 109 | array( 110 | 'key' => 'field_5449105ca6666', 111 | 'label' => 'Label', 112 | 'name' => 'label', 113 | 'type' => 'text', 114 | 'instructions' => '', 115 | 'required' => 0, 116 | 'conditional_logic' => 0, 117 | 'wrapper' => array( 118 | 'width' => '', 119 | 'class' => '', 120 | 'id' => '', 121 | ), 122 | 'default_value' => '', 123 | 'placeholder' => '', 124 | 'prepend' => '', 125 | 'append' => '', 126 | 'maxlength' => '', 127 | 'readonly' => 0, 128 | 'disabled' => 0, 129 | ), 130 | array( 131 | 'key' => 'field_54491082a6667', 132 | 'label' => 'Color', 133 | 'name' => 'color', 134 | 'type' => 'color_picker', 135 | 'instructions' => '', 136 | 'required' => 0, 137 | 'conditional_logic' => 0, 138 | 'wrapper' => array( 139 | 'width' => '', 140 | 'class' => '', 141 | 'id' => '', 142 | ), 143 | 'default_value' => '#333333', 144 | ), 145 | array( 146 | 'key' => 'field_5450fbbd85fa7', 147 | 'label' => 'Disable Text Color', 148 | 'name' => 'disable_text_color', 149 | 'type' => 'true_false', 150 | 'instructions' => '', 151 | 'required' => 0, 152 | 'conditional_logic' => array( 153 | array( 154 | array( 155 | 'field' => 'field_54490f59a6663', 156 | 'operator' => '==', 157 | 'value' => 'circle', 158 | ), 159 | ), 160 | ), 161 | 'wrapper' => array( 162 | 'width' => '', 163 | 'class' => '', 164 | 'id' => '', 165 | ), 166 | 'message' => '', 167 | 'default_value' => 1, 168 | ), 169 | ), 170 | ), 171 | array( 172 | 'key' => 'field_544ea678eee76', 173 | 'label' => 'Direction', 174 | 'name' => 'direction', 175 | 'type' => 'radio', 176 | 'instructions' => '', 177 | 'required' => 0, 178 | 'conditional_logic' => array( 179 | array( 180 | array( 181 | 'field' => 'field_54490f59a6663', 182 | 'operator' => '==', 183 | 'value' => 'bar', 184 | ), 185 | ), 186 | ), 187 | 'wrapper' => array( 188 | 'width' => '', 189 | 'class' => '', 190 | 'id' => '', 191 | ), 192 | 'choices' => array( 193 | 'right' => 'Right (default)', 194 | 'left' => 'Left', 195 | ), 196 | 'other_choice' => 0, 197 | 'save_other_choice' => 0, 198 | 'default_value' => 'right', 199 | 'layout' => 'horizontal', 200 | ), 201 | array( 202 | 'key' => 'field_544e64202d6b3', 203 | 'label' => 'Style Restrictions', 204 | 'name' => '', 205 | 'type' => 'message', 206 | 'instructions' => '', 207 | 'required' => 0, 208 | 'conditional_logic' => array( 209 | array( 210 | array( 211 | 'field' => 'field_54490f59a6663', 212 | 'operator' => '==', 213 | 'value' => 'bar', 214 | ), 215 | ), 216 | array( 217 | array( 218 | 'field' => 'field_54490f59a6663', 219 | 'operator' => '==', 220 | 'value' => 'circle', 221 | ), 222 | ), 223 | ), 224 | 'wrapper' => array( 225 | 'width' => '', 226 | 'class' => '', 227 | 'id' => '', 228 | ), 229 | 'message' => 'Note: This field style only supports percentage based values (0-100). Percent sign (%) is optional.', 230 | 'esc_html' => 0, 231 | ), 232 | array( 233 | 'key' => 'field_5459b5e0ee4a9', 234 | 'label' => 'Module Styles', 235 | 'name' => 'module_styles', 236 | 'type' => 'text', 237 | 'instructions' => 'Apply CSS directly to the module container element. Use to tweak positioning/layouts to perfection.', 238 | 'required' => 0, 239 | 'conditional_logic' => 0, 240 | 'wrapper' => array( 241 | 'width' => '', 242 | 'class' => '', 243 | 'id' => '', 244 | ), 245 | 'default_value' => '', 246 | 'placeholder' => '', 247 | 'prepend' => '', 248 | 'append' => '', 249 | 'maxlength' => '', 250 | 'readonly' => 0, 251 | 'disabled' => 0, 252 | ), 253 | ), 254 | 'min' => '', 255 | 'max' => '', 256 | ); 257 | 258 | return $layouts; 259 | } 260 | 261 | add_filter( 'acfmod/modules/counters', 'acfmod_modules_counters' ); 262 | 263 | global $acfmod_counters; 264 | $acfmod_counters = 0; 265 | 266 | /** 267 | * Counters Module 268 | */ 269 | function acfmod_modules_counters() { 270 | $style = get_sub_field( 'style' ); 271 | $direction = get_sub_field( 'direction' ); 272 | $attribute = 'color'; 273 | 274 | if ( 'bar' === $style ) { 275 | wp_enqueue_script( 'waypoints' ); 276 | $attribute = 'background-color'; 277 | } else { 278 | wp_enqueue_script( 'jquery-counterup' ); 279 | } 280 | 281 | if ( 'plain' !== $style ) { 282 | wp_enqueue_script( 'jquery-easypiechart' ); 283 | } 284 | 285 | $output = ''; 286 | 287 | if ( have_rows( 'stats' ) ) { 288 | 289 | global $acfmod_counters; 290 | $output .= ''; 359 | 360 | } 361 | 362 | return $output; 363 | } 364 | -------------------------------------------------------------------------------- /modules/gravity-form.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "key":"group_543c1c5fdde54", 4 | "title":"Content Modules", 5 | "fields":[ 6 | { 7 | "key":"field_543d7bc015b3d", 8 | "label":"Modules", 9 | "name":"_acfmod_modules", 10 | "type":"flexible_content", 11 | "instructions":"Create many different types of content by selecting the module and filling in the fields.", 12 | "required":0, 13 | "conditional_logic":0, 14 | "wrapper":{ 15 | "width":"", 16 | "class":"", 17 | "id":"" 18 | }, 19 | "button_label":"Add Module", 20 | "min":0, 21 | "max":"", 22 | "layouts":[ 23 | { 24 | "key":"54665a37a7c21", 25 | "name":"gravity_form", 26 | "label":"Gravity Form", 27 | "display":"row", 28 | "sub_fields":[ 29 | { 30 | "key":"field_54665a45a7c22", 31 | "label":"Select Form", 32 | "name":"form", 33 | "type":"gravity_forms_field", 34 | "instructions":"", 35 | "required":0, 36 | "conditional_logic":0, 37 | "wrapper":{ 38 | "width":"", 39 | "class":"", 40 | "id":"" 41 | }, 42 | "allow_null":0, 43 | "allow_multiple":1, 44 | "multiple":0 45 | }, 46 | { 47 | "key":"field_5481db4801885", 48 | "label":"Display Title?", 49 | "name":"title", 50 | "type":"true_false", 51 | "instructions":"", 52 | "required":0, 53 | "conditional_logic":0, 54 | "wrapper":{ 55 | "width":"", 56 | "class":"", 57 | "id":"" 58 | }, 59 | "message":"", 60 | "default_value":0 61 | }, 62 | { 63 | "key":"field_5481db6601886", 64 | "label":"Display Description?", 65 | "name":"description", 66 | "type":"true_false", 67 | "instructions":"", 68 | "required":0, 69 | "conditional_logic":0, 70 | "wrapper":{ 71 | "width":"", 72 | "class":"", 73 | "id":"" 74 | }, 75 | "message":"", 76 | "default_value":0 77 | }, 78 | { 79 | "key":"field_5481db8101887", 80 | "label":"Use AJAX?", 81 | "name":"ajax", 82 | "type":"true_false", 83 | "instructions":"", 84 | "required":0, 85 | "conditional_logic":0, 86 | "wrapper":{ 87 | "width":"", 88 | "class":"", 89 | "id":"" 90 | }, 91 | "message":"", 92 | "default_value":0 93 | }, 94 | { 95 | "key":"field_5481dbb901888", 96 | "label":"Tab Index", 97 | "name":"tabindex", 98 | "type":"number", 99 | "instructions":"", 100 | "required":0, 101 | "conditional_logic":0, 102 | "wrapper":{ 103 | "width":"", 104 | "class":"", 105 | "id":"" 106 | }, 107 | "default_value":20, 108 | "placeholder":"", 109 | "prepend":"", 110 | "append":"", 111 | "min":"", 112 | "max":"", 113 | "step":"", 114 | "readonly":0, 115 | "disabled":0 116 | } 117 | ], 118 | "min":"", 119 | "max":"" 120 | } 121 | ] 122 | } 123 | ], 124 | "location":[ 125 | [ 126 | { 127 | "param":"post_type", 128 | "operator":"==", 129 | "value":"page" 130 | } 131 | ] 132 | ], 133 | "menu_order":10, 134 | "position":"normal", 135 | "style":"default", 136 | "label_placement":"top", 137 | "instruction_placement":"label", 138 | "hide_on_screen":[ 139 | "the_content", 140 | "excerpt" 141 | ] 142 | } 143 | ] 144 | -------------------------------------------------------------------------------- /modules/gravity-form.php: -------------------------------------------------------------------------------- 1 | '54665a37a7c21', 23 | 'name' => 'gravity_form', 24 | 'label' => 'Gravity Form', 25 | 'display' => 'row', 26 | 'sub_fields' => array( 27 | array( 28 | 'key' => 'field_54665a45a7c22', 29 | 'label' => 'Select Form', 30 | 'name' => 'form', 31 | 'type' => 'gravity_forms_field', 32 | 'instructions' => '', 33 | 'required' => 0, 34 | 'conditional_logic' => 0, 35 | 'wrapper' => array( 36 | 'width' => '', 37 | 'class' => '', 38 | 'id' => '', 39 | ), 40 | 'allow_null' => 0, 41 | 'allow_multiple' => 1, 42 | 'multiple' => 0, 43 | ), 44 | array( 45 | 'key' => 'field_5481db4801885', 46 | 'label' => 'Display Title?', 47 | 'name' => 'title', 48 | 'type' => 'true_false', 49 | 'instructions' => '', 50 | 'required' => 0, 51 | 'conditional_logic' => 0, 52 | 'wrapper' => array( 53 | 'width' => '', 54 | 'class' => '', 55 | 'id' => '', 56 | ), 57 | 'message' => '', 58 | 'default_value' => 0, 59 | ), 60 | array( 61 | 'key' => 'field_5481db6601886', 62 | 'label' => 'Display Description?', 63 | 'name' => 'description', 64 | 'type' => 'true_false', 65 | 'instructions' => '', 66 | 'required' => 0, 67 | 'conditional_logic' => 0, 68 | 'wrapper' => array( 69 | 'width' => '', 70 | 'class' => '', 71 | 'id' => '', 72 | ), 73 | 'message' => '', 74 | 'default_value' => 0, 75 | ), 76 | array( 77 | 'key' => 'field_5481db8101887', 78 | 'label' => 'Use AJAX?', 79 | 'name' => 'ajax', 80 | 'type' => 'true_false', 81 | 'instructions' => '', 82 | 'required' => 0, 83 | 'conditional_logic' => 0, 84 | 'wrapper' => array( 85 | 'width' => '', 86 | 'class' => '', 87 | 'id' => '', 88 | ), 89 | 'message' => '', 90 | 'default_value' => 0, 91 | ), 92 | array( 93 | 'key' => 'field_5481dbb901888', 94 | 'label' => 'Tab Index', 95 | 'name' => 'tabindex', 96 | 'type' => 'number', 97 | 'instructions' => '', 98 | 'required' => 0, 99 | 'conditional_logic' => 0, 100 | 'wrapper' => array( 101 | 'width' => '', 102 | 'class' => '', 103 | 'id' => '', 104 | ), 105 | 'default_value' => 20, 106 | 'placeholder' => '', 107 | 'prepend' => '', 108 | 'append' => '', 109 | 'min' => '', 110 | 'max' => '', 111 | 'step' => '', 112 | 'readonly' => 0, 113 | 'disabled' => 0, 114 | ), 115 | ), 116 | 'min' => '', 117 | 'max' => '', 118 | ); 119 | 120 | return $layouts; 121 | } 122 | 123 | add_filter( 'acfmod/modules/gravity_form', 'acfmod_modules_gravity_form' ); 124 | 125 | /** 126 | * Gravity Form Module 127 | * 128 | * @return html Module Output 129 | */ 130 | function acfmod_modules_gravity_form() { 131 | $output = ''; 132 | 133 | if ( ! function_exists( 'gravity_form' ) ) { 134 | return $output; 135 | } 136 | 137 | $form = get_sub_field( 'form' ); 138 | $title = get_sub_field( 'title' ); 139 | $description = get_sub_field( 'description' ); 140 | $ajax = get_sub_field( 'ajax' ); 141 | $tabindex = get_sub_field( 'tabindex' ); 142 | 143 | if ( empty( $tabindex ) ) { 144 | $tabindex = 20; 145 | } 146 | 147 | if ( ! empty( $form ) ) { 148 | $output = gravity_form( $form->id, $title, $description, false, array(), $ajax, $tabindex, false ); 149 | } 150 | 151 | return $output; 152 | } 153 | -------------------------------------------------------------------------------- /modules/icon-blocks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "key":"groupconfig_543c1c5fdde54", 4 | "title":"Content Modules", 5 | "fields":[ 6 | { 7 | "key":"fieldconfig_543d7bc015b3d", 8 | "label":"Modules", 9 | "name":"_acfmod_config_modules", 10 | "type":"flexible_content", 11 | "instructions":"Create many different types of content by selecting the module and filling in the fields.", 12 | "required":0, 13 | "conditional_logic":0, 14 | "wrapper":{ 15 | "width":"", 16 | "class":"", 17 | "id":"" 18 | }, 19 | "button_label":"Add Module", 20 | "min":0, 21 | "max":"", 22 | "layouts":[ 23 | { 24 | "key":"config543eb572cb630", 25 | "name":"icon_blocks", 26 | "label":"Icon Blocks", 27 | "display":"row", 28 | "sub_fields":[ 29 | { 30 | "key": "fieldconfig_5469b74ef1d78", 31 | "label": "CSS Class", 32 | "name": "css_class", 33 | "type": "text", 34 | "instructions": "", 35 | "required": 0, 36 | "conditional_logic": 0, 37 | "wrapper": { 38 | "width": "", 39 | "class": "", 40 | "id": "" 41 | }, 42 | "default_value": "", 43 | "placeholder": "", 44 | "prepend": "", 45 | "append": "", 46 | "maxlength": "", 47 | "readonly": 0, 48 | "disabled": 0 49 | }, 50 | { 51 | "key":"fieldconfig_543eb6b846edd", 52 | "label":"Icons", 53 | "name":"icons", 54 | "type":"repeater", 55 | "instructions":"", 56 | "required":0, 57 | "conditional_logic":0, 58 | "wrapper":{ 59 | "width":"", 60 | "class":"", 61 | "id":"" 62 | }, 63 | "min":1, 64 | "max":6, 65 | "layout":"row", 66 | "button_label":"Add Icon Block", 67 | "sub_fields":[ 68 | { 69 | "key":"fieldconfig_543eb580cb631", 70 | "label":"Icon", 71 | "name":"icon", 72 | "type":"image", 73 | "instructions":"", 74 | "required":0, 75 | "conditional_logic":0, 76 | "wrapper":{ 77 | "width":"", 78 | "class":"", 79 | "id":"" 80 | }, 81 | "return_format":"array", 82 | "preview_size":"thumbnail", 83 | "library":"all", 84 | "min_width":0, 85 | "min_height":0, 86 | "min_size":0, 87 | "max_width":0, 88 | "max_height":0, 89 | "max_size":0, 90 | "mime_types":"" 91 | }, 92 | { 93 | "key":"fieldconfig_543eb590cb632", 94 | "label":"Heading", 95 | "name":"heading", 96 | "type":"text", 97 | "instructions":"", 98 | "required":0, 99 | "conditional_logic":0, 100 | "wrapper":{ 101 | "width":"", 102 | "class":"", 103 | "id":"" 104 | }, 105 | "default_value":"", 106 | "placeholder":"", 107 | "prepend":"", 108 | "append":"", 109 | "maxlength":"", 110 | "readonly":0, 111 | "disabled":0 112 | }, 113 | { 114 | "key":"fieldconfig_5460c8fde86b0", 115 | "label":"Heading Color", 116 | "name":"heading_color", 117 | "type":"color_picker", 118 | "instructions":"(optional)", 119 | "required":0, 120 | "conditional_logic":0, 121 | "wrapper":{ 122 | "width":"", 123 | "class":"", 124 | "id":"" 125 | }, 126 | "default_value":"" 127 | }, 128 | { 129 | "key":"fieldconfig_543eb59dcb633", 130 | "label":"Text Content", 131 | "name":"text", 132 | "type":"textarea", 133 | "instructions":"", 134 | "required":0, 135 | "conditional_logic":0, 136 | "wrapper":{ 137 | "width":"", 138 | "class":"", 139 | "id":"" 140 | }, 141 | "default_value":"", 142 | "placeholder":"", 143 | "maxlength":"", 144 | "rows":4, 145 | "new_lines":"", 146 | "readonly":0, 147 | "disabled":0 148 | }, 149 | { 150 | "key":"fieldconfig_543eb5bfcb634", 151 | "label":"Page Link", 152 | "name":"page_link", 153 | "type":"page_link", 154 | "instructions":"", 155 | "required":0, 156 | "conditional_logic":0, 157 | "wrapper":{ 158 | "width":"", 159 | "class":"", 160 | "id":"" 161 | }, 162 | "post_type":[ 163 | "page" 164 | ], 165 | "taxonomy":[ 166 | 167 | ], 168 | "allow_null":1, 169 | "multiple":0 170 | }, 171 | { 172 | "key":"fieldconfig_543eb5d7cb635", 173 | "label":"Custom URL", 174 | "name":"custom_url", 175 | "type":"url", 176 | "instructions":"", 177 | "required":0, 178 | "conditional_logic":0, 179 | "wrapper":{ 180 | "width":"", 181 | "class":"", 182 | "id":"" 183 | }, 184 | "default_value":"", 185 | "placeholder":"" 186 | }, 187 | { 188 | "key": "fieldconfig_558a23ed3389b", 189 | "label": "Link Target", 190 | "name": "link_target", 191 | "type": "select", 192 | "instructions": "", 193 | "required": 0, 194 | "conditional_logic": 0, 195 | "wrapper": { 196 | "width": "", 197 | "class": "", 198 | "id": "" 199 | }, 200 | "choices": { 201 | "_blank": "Blank (New Window)", 202 | "_top": "Top", 203 | "_parent": "Parent", 204 | "_self": "Self" 205 | }, 206 | "default_value": { 207 | "": "" 208 | }, 209 | "allow_null": 1, 210 | "multiple": 0, 211 | "ui": 0, 212 | "ajax": 0, 213 | "placeholder": "", 214 | "disabled": 0, 215 | "readonly": 0 216 | }, 217 | { 218 | "key":"fieldconfig_543eb5ebcb636", 219 | "label":"Call to Action Text", 220 | "name":"cta_text", 221 | "type":"text", 222 | "instructions":"", 223 | "required":0, 224 | "conditional_logic":0, 225 | "wrapper":{ 226 | "width":"", 227 | "class":"", 228 | "id":"" 229 | }, 230 | "default_value":"View Details", 231 | "placeholder":"", 232 | "prepend":"", 233 | "append":"", 234 | "maxlength":"", 235 | "readonly":0, 236 | "disabled":0 237 | } 238 | ] 239 | } 240 | ], 241 | "min":"", 242 | "max":"" 243 | } 244 | ] 245 | } 246 | ], 247 | "location":[ 248 | [ 249 | { 250 | "param":"post_type", 251 | "operator":"==", 252 | "value":"page" 253 | }, 254 | { 255 | "param":"page_template", 256 | "operator":"!=", 257 | "value":"page_blog.php" 258 | } 259 | ] 260 | ], 261 | "menu_order":10, 262 | "position":"normal", 263 | "style":"default", 264 | "label_placement":"top", 265 | "instruction_placement":"label", 266 | "hide_on_screen":[ 267 | "the_content", 268 | "excerpt" 269 | ] 270 | } 271 | ] 272 | -------------------------------------------------------------------------------- /modules/icon-blocks.php: -------------------------------------------------------------------------------- 1 | '543eb572cb630', 19 | 'name' => 'icon_blocks', 20 | 'label' => 'Icon Blocks', 21 | 'display' => 'row', 22 | 'sub_fields' => array( 23 | array( 24 | 'key' => 'field_5469b74ef1d78', 25 | 'label' => 'CSS Class', 26 | 'name' => 'css_class', 27 | 'type' => 'text', 28 | 'instructions' => '', 29 | 'required' => 0, 30 | 'conditional_logic' => 0, 31 | 'wrapper' => array( 32 | 'width' => '', 33 | 'class' => '', 34 | 'id' => '', 35 | ), 36 | 'default_value' => '', 37 | 'placeholder' => '', 38 | 'prepend' => '', 39 | 'append' => '', 40 | 'maxlength' => '', 41 | 'readonly' => 0, 42 | 'disabled' => 0, 43 | ), 44 | array( 45 | 'key' => 'field_543eb6b846edd', 46 | 'label' => 'Icons', 47 | 'name' => 'icons', 48 | 'type' => 'repeater', 49 | 'instructions' => '', 50 | 'required' => 0, 51 | 'conditional_logic' => 0, 52 | 'wrapper' => array( 53 | 'width' => '', 54 | 'class' => '', 55 | 'id' => '', 56 | ), 57 | 'min' => 1, 58 | 'max' => 6, 59 | 'layout' => 'row', 60 | 'button_label' => 'Add Icon', 61 | 'sub_fields' => array( 62 | array( 63 | 'key' => 'field_543eb580cb631', 64 | 'label' => 'Icon', 65 | 'name' => 'icon', 66 | 'type' => 'image', 67 | 'instructions' => '', 68 | 'required' => 0, 69 | 'conditional_logic' => 0, 70 | 'wrapper' => array( 71 | 'width' => '', 72 | 'class' => '', 73 | 'id' => '', 74 | ), 75 | 'return_format' => 'array', 76 | 'preview_size' => 'thumbnail', 77 | 'library' => 'all', 78 | 'min_width' => 0, 79 | 'min_height' => 0, 80 | 'min_size' => 0, 81 | 'max_width' => 0, 82 | 'max_height' => 0, 83 | 'max_size' => 0, 84 | 'mime_types' => '', 85 | ), 86 | array( 87 | 'key' => 'field_543eb590cb632', 88 | 'label' => 'Heading', 89 | 'name' => 'heading', 90 | 'type' => 'text', 91 | 'instructions' => '', 92 | 'required' => 0, 93 | 'conditional_logic' => 0, 94 | 'wrapper' => array( 95 | 'width' => '', 96 | 'class' => '', 97 | 'id' => '', 98 | ), 99 | 'default_value' => '', 100 | 'placeholder' => '', 101 | 'prepend' => '', 102 | 'append' => '', 103 | 'maxlength' => '', 104 | 'readonly' => 0, 105 | 'disabled' => 0, 106 | ), 107 | array( 108 | 'key' => 'field_5460c8fde86b0', 109 | 'label' => 'Heading Color', 110 | 'name' => 'heading_color', 111 | 'type' => 'color_picker', 112 | 'instructions' => '(optional)', 113 | 'required' => 0, 114 | 'conditional_logic' => 0, 115 | 'wrapper' => array( 116 | 'width' => '', 117 | 'class' => '', 118 | 'id' => '', 119 | ), 120 | 'default_value' => '', 121 | ), 122 | array( 123 | 'key' => 'field_543eb59dcb633', 124 | 'label' => 'Text Content', 125 | 'name' => 'text', 126 | 'type' => 'textarea', 127 | 'instructions' => '', 128 | 'required' => 0, 129 | 'conditional_logic' => 0, 130 | 'wrapper' => array( 131 | 'width' => '', 132 | 'class' => '', 133 | 'id' => '', 134 | ), 135 | 'default_value' => '', 136 | 'placeholder' => '', 137 | 'maxlength' => '', 138 | 'rows' => 4, 139 | 'new_lines' => '', 140 | 'readonly' => 0, 141 | 'disabled' => 0, 142 | ), 143 | array( 144 | 'key' => 'field_543eb5bfcb634', 145 | 'label' => 'Page Link', 146 | 'name' => 'page_link', 147 | 'type' => 'page_link', 148 | 'instructions' => '', 149 | 'required' => 0, 150 | 'conditional_logic' => 0, 151 | 'wrapper' => array( 152 | 'width' => '', 153 | 'class' => '', 154 | 'id' => '', 155 | ), 156 | 'post_type' => array( 157 | 0 => 'page', 158 | ), 159 | 'taxonomy' => array(), 160 | 'allow_null' => 1, 161 | 'multiple' => 0, 162 | ), 163 | array( 164 | 'key' => 'field_543eb5d7cb635', 165 | 'label' => 'Custom URL', 166 | 'name' => 'custom_url', 167 | 'type' => 'url', 168 | 'instructions' => '', 169 | 'required' => 0, 170 | 'conditional_logic' => 0, 171 | 'wrapper' => array( 172 | 'width' => '', 173 | 'class' => '', 174 | 'id' => '', 175 | ), 176 | 'default_value' => '', 177 | 'placeholder' => '', 178 | ), 179 | array( 180 | 'key' => 'field_558a23ed3389b', 181 | 'label' => 'Link Target', 182 | 'name' => 'link_target', 183 | 'type' => 'select', 184 | 'instructions' => '', 185 | 'required' => 0, 186 | 'conditional_logic' => 0, 187 | 'wrapper' => array( 188 | 'width' => '', 189 | 'class' => '', 190 | 'id' => '', 191 | ), 192 | 'choices' => array( 193 | '_blank' => 'Blank (New Window)', 194 | '_top' => 'Top', 195 | '_parent' => 'Parent', 196 | '_self' => 'Self', 197 | ), 198 | 'default_value' => array( 199 | '' => '', 200 | ), 201 | 'allow_null' => 1, 202 | 'multiple' => 0, 203 | 'ui' => 0, 204 | 'ajax' => 0, 205 | 'placeholder' => '', 206 | 'disabled' => 0, 207 | 'readonly' => 0, 208 | ), 209 | array( 210 | 'key' => 'field_543eb5ebcb636', 211 | 'label' => 'Call to Action Text', 212 | 'name' => 'cta_text', 213 | 'type' => 'text', 214 | 'instructions' => '', 215 | 'required' => 0, 216 | 'conditional_logic' => 0, 217 | 'wrapper' => array( 218 | 'width' => '', 219 | 'class' => '', 220 | 'id' => '', 221 | ), 222 | 'default_value' => 'View Details', 223 | 'placeholder' => '', 224 | 'prepend' => '', 225 | 'append' => '', 226 | 'maxlength' => '', 227 | 'readonly' => 0, 228 | 'disabled' => 0, 229 | ), 230 | ), 231 | ), 232 | ), 233 | 'min' => '', 234 | 'max' => '', 235 | ); 236 | 237 | return $layouts; 238 | } 239 | 240 | add_action( 'wp_enqueue_scripts', 'acfmod_register_icon_blocks_enqueues' ); 241 | 242 | /** 243 | * Icon Blocks scripts and styles 244 | */ 245 | function acfmod_register_icon_blocks_enqueues() { 246 | wp_register_style( 'acfmod-icon-blocks', ACFMOD_URI . 'assets/css/icon-blocks.min.css' ); 247 | } 248 | 249 | add_filter( 'acfmod/modules/icon_blocks', 'acfmod_modules_icon_blocks' ); 250 | 251 | /** 252 | * Icon Blocks Module 253 | * 254 | * @return html Module Output 255 | */ 256 | function acfmod_modules_icon_blocks() { 257 | $output = ''; 258 | 259 | $css_class = trim( get_sub_field( 'css_class' ) ); 260 | $count = count( get_sub_field( 'icons' ) ); 261 | 262 | if ( have_rows( 'icons' ) ) { 263 | wp_enqueue_style( 'acfmod-icon-blocks' ); 264 | 265 | $output .= ''; 317 | 318 | } 319 | 320 | return $output; 321 | } 322 | -------------------------------------------------------------------------------- /modules/iframe.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "key": "group_543c1c5fdde54", 4 | "title": "Content Modules", 5 | "fields": [ 6 | { 7 | "key": "field_543d7bc015b3d", 8 | "label": "Modules", 9 | "name": "_acfmod_modules", 10 | "type": "flexible_content", 11 | "instructions": "Create many different types of content by selecting the module and filling in the fields.", 12 | "required": 0, 13 | "conditional_logic": 0, 14 | "wrapper": { 15 | "width": "", 16 | "class": "", 17 | "id": "" 18 | }, 19 | "button_label": "Add Module", 20 | "min": 0, 21 | "max": "", 22 | "layouts": [ 23 | { 24 | "key": "5569b8d6d0990", 25 | "name": "iframe", 26 | "label": "Iframe", 27 | "display": "block", 28 | "sub_fields": [ 29 | { 30 | "key": "field_5569b8f3f0d71", 31 | "label": "Iframe URL", 32 | "name": "url", 33 | "type": "text", 34 | "instructions": "", 35 | "required": 1, 36 | "conditional_logic": 0, 37 | "wrapper": { 38 | "width": "", 39 | "class": "", 40 | "id": "" 41 | }, 42 | "default_value": "", 43 | "placeholder": "http:\/\/", 44 | "prepend": "", 45 | "append": "", 46 | "maxlength": "", 47 | "readonly": 0, 48 | "disabled": 0 49 | }, 50 | { 51 | "key": "field_556a5c009bee8", 52 | "label": "Iframe Height", 53 | "name": "height", 54 | "type": "number", 55 | "instructions": "", 56 | "required": 0, 57 | "conditional_logic": 0, 58 | "wrapper": { 59 | "width": "", 60 | "class": "", 61 | "id": "" 62 | }, 63 | "default_value": "", 64 | "placeholder": "", 65 | "prepend": "", 66 | "append": "", 67 | "min": "", 68 | "max": "", 69 | "step": "", 70 | "readonly": 0, 71 | "disabled": 0 72 | }, 73 | { 74 | "key": "field_5569b94ef0d72", 75 | "label": "CSS Class", 76 | "name": "css_class", 77 | "type": "text", 78 | "instructions": "", 79 | "required": 0, 80 | "conditional_logic": 0, 81 | "wrapper": { 82 | "width": "", 83 | "class": "", 84 | "id": "" 85 | }, 86 | "default_value": "", 87 | "placeholder": "", 88 | "prepend": "", 89 | "append": "", 90 | "maxlength": "", 91 | "readonly": 0, 92 | "disabled": 0 93 | }, 94 | { 95 | "key": "field_5569b983f0d73", 96 | "label": "Module Styles", 97 | "name": "module_styles", 98 | "type": "text", 99 | "instructions": "Apply CSS directly to the module container element. Use to tweak positioning\/layouts to perfection.", 100 | "required": 0, 101 | "conditional_logic": 0, 102 | "wrapper": { 103 | "width": "", 104 | "class": "", 105 | "id": "" 106 | }, 107 | "default_value": "", 108 | "placeholder": "", 109 | "prepend": "", 110 | "append": "", 111 | "maxlength": "", 112 | "readonly": 0, 113 | "disabled": 0 114 | } 115 | ], 116 | "min": "", 117 | "max": "" 118 | } 119 | ] 120 | } 121 | ], 122 | "location": [ 123 | [ 124 | { 125 | "param": "post_type", 126 | "operator": "==", 127 | "value": "page" 128 | } 129 | ] 130 | ], 131 | "menu_order": 10, 132 | "position": "normal", 133 | "style": "default", 134 | "label_placement": "top", 135 | "instruction_placement": "label", 136 | "hide_on_screen": [ 137 | "the_content", 138 | "excerpt" 139 | ] 140 | } 141 | ] -------------------------------------------------------------------------------- /modules/iframe.php: -------------------------------------------------------------------------------- 1 | '5569b8d6d0990', 20 | 'name' => 'iframe', 21 | 'label' => 'Iframe', 22 | 'display' => 'block', 23 | 'sub_fields' => array( 24 | array( 25 | 'key' => 'field_5569b8f3f0d71', 26 | 'label' => 'Iframe URL', 27 | 'name' => 'url', 28 | 'type' => 'text', 29 | 'instructions' => '', 30 | 'required' => 1, 31 | 'conditional_logic' => 0, 32 | 'wrapper' => array( 33 | 'width' => '', 34 | 'class' => '', 35 | 'id' => '', 36 | ), 37 | 'default_value' => '', 38 | 'placeholder' => 'http://', 39 | 'prepend' => '', 40 | 'append' => '', 41 | 'maxlength' => '', 42 | 'readonly' => 0, 43 | 'disabled' => 0, 44 | ), 45 | array( 46 | 'key' => 'field_556a5c009bee8', 47 | 'label' => 'Iframe Height', 48 | 'name' => 'height', 49 | 'type' => 'number', 50 | 'instructions' => '', 51 | 'required' => 0, 52 | 'conditional_logic' => 0, 53 | 'wrapper' => array( 54 | 'width' => '', 55 | 'class' => '', 56 | 'id' => '', 57 | ), 58 | 'default_value' => '', 59 | 'placeholder' => '', 60 | 'prepend' => '', 61 | 'append' => 'px', 62 | 'min' => '', 63 | 'max' => '', 64 | 'step' => '', 65 | 'readonly' => 0, 66 | 'disabled' => 0, 67 | ), 68 | array( 69 | 'key' => 'field_5569b94ef0d72', 70 | 'label' => 'CSS Class', 71 | 'name' => 'css_class', 72 | 'type' => 'text', 73 | 'instructions' => '', 74 | 'required' => 0, 75 | 'conditional_logic' => 0, 76 | 'wrapper' => array( 77 | 'width' => '', 78 | 'class' => '', 79 | 'id' => '', 80 | ), 81 | 'default_value' => '', 82 | 'placeholder' => '', 83 | 'prepend' => '', 84 | 'append' => '', 85 | 'maxlength' => '', 86 | 'readonly' => 0, 87 | 'disabled' => 0, 88 | ), 89 | array( 90 | 'key' => 'field_5569b983f0d73', 91 | 'label' => 'Module Styles', 92 | 'name' => 'module_styles', 93 | 'type' => 'text', 94 | 'instructions' => 'Apply CSS directly to the module container element. Use to tweak positioning/layouts to perfection.', 95 | 'required' => 0, 96 | 'conditional_logic' => 0, 97 | 'wrapper' => array( 98 | 'width' => '', 99 | 'class' => '', 100 | 'id' => '', 101 | ), 102 | 'default_value' => '', 103 | 'placeholder' => '', 104 | 'prepend' => '', 105 | 'append' => '', 106 | 'maxlength' => '', 107 | 'readonly' => 0, 108 | 'disabled' => 0, 109 | ), 110 | ), 111 | 'min' => '', 112 | 'max' => '', 113 | ); 114 | 115 | return $layouts; 116 | } 117 | 118 | add_filter( 'acfmod/modules/iframe', 'acfmod_modules_iframe' ); 119 | 120 | /** 121 | * Iframe Module 122 | * 123 | * @return html Module Output 124 | */ 125 | function acfmod_modules_iframe() { 126 | $url = trim( get_sub_field( 'url' ) ); 127 | $css_class = trim( get_sub_field( 'css_class' ) ); 128 | $height = trim( get_sub_field( 'height' ) ); 129 | 130 | $output = '