Guest User

Untitled

a guest
Nov 18th, 2021
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.87 KB | None | 0 0
  1. <?php
  2. /**
  3. * Blog Layout Tab
  4. * ===============
  5. *
  6. * @since 4.8.2
  7. */
  8. if( ! defined( ‘ABSPATH’ ) ) { exit; } // Exit if accessed directly
  9.  
  10. global $avia_config, $avia_pages, $avia_elements;
  11.  
  12. /**
  13. * This is only a temporary solution – will be moved to a class later
  14. */
  15. $avia_config[‘social_icon_array’] = array(
  16. ‘500px’ => ‘five_100_px’,
  17. ‘Behance’ => ‘behance’,
  18. ‘Dribbble’ => ‘dribbble’,
  19. ‘Facebook’ => ‘facebook’,
  20. ‘Flickr’ => ‘flickr’,
  21. ‘Instagram’ => ‘instagram’,
  22. ‘LinkedIn’ => ‘linkedin’,
  23. ‘Pinterest’ => ‘pinterest’,
  24. ‘Reddit’ => ‘reddit’,
  25. ‘Skype’ => ‘skype’,
  26. ‘Soundcloud’ => ‘soundcloud’,
  27. ‘Tumblr’ => ‘tumblr’,
  28. ‘Twitter’ => ‘twitter’,
  29. ‘Vimeo’ => ‘vimeo’,
  30. ‘Vk’ => ‘vk’,
  31. ‘Xing’ => ‘xing’,
  32. ‘Yelp’ => ‘yelp’,
  33. ‘YouTube’ => ‘youtube’,
  34. ‘WhatsApp’ => ‘whatsapp’,
  35. __( ‘Special: RSS (add RSS URL, leave blank if you want to use default WordPress RSS feed)’, ‘avia_framework’ ) => ‘rss’,
  36. __( ‘Special: Email Icon (add your own URL to link to a contact form)’, ‘avia_framework’ ) => ‘mail’,
  37. );
  38.  
  39. /**
  40. * @since ????
  41. * @param array $social_icon_array
  42. * @return array
  43. */
  44. $avia_config[‘social_icon_array’] = apply_filters( ‘avf_social_icons_options’, $avia_config[‘social_icon_array’] );
  45.  
  46. $avia_config[‘social_share_array’] = array(
  47. ‘Facebook’ => ‘facebook’,
  48. ‘Twitter’ => ‘twitter’,
  49. ‘WhatsApp’ => ‘whatsapp’,
  50. ‘Pinterest’ => ‘pinterest’,
  51. ‘Reddit’ => ‘reddit’,
  52. ‘LinkedIn’ => ‘linkedin’,
  53. ‘Tumblr’ => ‘tumblr’,
  54. ‘Vk’ => ‘vk’,
  55. ‘Yelp’ => ‘yelp’,
  56. __( ‘Special: Email Icon (add your own URL to link to a contact form)’, ‘avia_framework’ ) => ‘mail’
  57. );
  58.  
  59. /**
  60. * @since 4.8.4.1
  61. * @param array $avia_config[‘social_share_array’]
  62. * @return array
  63. */
  64. $avia_config[‘social_share_array’] = apply_filters( ‘avf_social_share_array_options’, $avia_config[‘social_share_array’] );
  65.  
  66. $avia_config[‘social_profile_array’] = array_diff( $avia_config[‘social_icon_array’], $avia_config[‘social_share_array’] );
  67.  
  68. $avia_elements[] = array(
  69. ‘slug’ => ‘blog’,
  70. ‘name’ => __( ‘Blog Styling’, ‘avia_framework’ ),
  71. ‘desc’ => __( ‘Choose the blog styling here.’, ‘avia_framework’ ),
  72. ‘id’ => ‘blog_global_style’,
  73. ‘type’ => ‘select’,
  74. ‘std’ => ”,
  75. ‘no_first’ => true,
  76. ‘subtype’ => array(
  77. __( ‘Default (Business)’, ‘avia_framework’ ) => ”,
  78. __( ‘Elegant’, ‘avia_framework’ ) => ‘elegant-blog’,
  79. __( ‘Modern Business’, ‘avia_framework’ ) => ‘elegant-blog modern-blog’,
  80. )
  81. );
  82.  
  83. $avia_elements[] = array(
  84. ‘slug’ => ‘blog’,
  85. ‘name’ => __( ‘Blog Layout’, ‘avia_framework’ ),
  86. ‘desc’ => __( ‘Choose the default blog layout here.’, ‘avia_framework’ ) . ‘<br/><br/>’ . __( ‘You can either choose a predefined layout or build your own blog layout with the advanced layout editor’, ‘avia_framework’ ),
  87. ‘id’ => ‘blog_style’,
  88. ‘type’ => ‘select’,
  89. ‘std’ => ‘single-small’,
  90. ‘no_first’ => true,
  91. ‘subtype’ => array(
  92. __( ‘Multi Author Blog (displays Gravatar of the article author beside the entry and feature images above)’, ‘avia_framework’ ) => ‘multi-big’,
  93. __( ‘Single Author, small preview Pic (no author picture is displayed, feature image is small)’, ‘avia_framework’ ) => ‘single-small’,
  94. __( ‘Single Author, big preview Pic (no author picture is displayed, feature image is big)’, ‘avia_framework’ ) => ‘single-big’,
  95. __( ‘Grid Layout’, ‘avia_framework’ ) => ‘blog-grid’,
  96. __( ‘List Layout – Simple (Title and meta information only)’, ‘avia_framework’ ) => ‘bloglist-simple’,
  97. __( ‘List Layout – Compact (Title and icon only)’, ‘avia_framework’ ) => ‘bloglist-compact’,
  98. __( ‘List Layout – Excerpt (Title, meta information and excerpt only)’, ‘avia_framework’ ) => ‘bloglist-excerpt’,
  99. __( ‘Use the advance layout editor to build your own blog layout (simply edit the page you have chosen in Enfold->Theme Options as a blog page)’, ‘avia_framework’ ) => ‘custom’,
  100. )
  101. );
  102.  
  103. $avia_elements[] = array(
  104. ‘slug’ => ‘blog’,
  105. ‘type’ => ‘visual_group_start’,
  106. ‘id’ => ‘avia_blog_post_options_start’,
  107. ‘nodescription’ => true
  108. );
  109.  
  110. $avia_elements[] = array(
  111. ‘slug’ => ‘blog’,
  112. ‘name’ => __( ‘Single Post Options’, ‘avia_framework’ ),
  113. ‘desc’ => __( ‘Here you can set options that affect your single blog post layout’, ‘avia_framework’ ),
  114. ‘id’ => ‘blog_widgetdescription’,
  115. ‘type’ => ‘heading’,
  116. ‘nodescription’ => true
  117. );
  118.  
  119. $avia_elements[] = array(
  120. ‘slug’ => ‘blog’,
  121. ‘name’ => __( ‘Single Post Navigation’, ‘avia_framework’ ),
  122. ‘desc’ => __( ‘Select to disable or enable the post navigation that links to the next/previous post on single entries. Setting is also used for portfolio. Use filter avf_post_nav_settings to customize.’, ‘avia_framework’ ),
  123. ‘id’ => ‘disable_post_nav’,
  124. ‘type’ => ‘select’,
  125. ‘no_first’ => true,
  126. ‘std’ => ”,
  127. ‘subtype’ => array(
  128. __( ‘Enable post navigation’, ‘avia_framework’ ) => ”,
  129. __( ‘Disable post navigation’, ‘avia_framework’ ) => ‘disable_post_nav’,
  130. __( ‘Loop post navigation’, ‘avia_framework’ ) => ‘loop_post_nav’
  131. )
  132. );
  133.  
  134. $avia_elements[] = array(
  135. ‘slug’ => ‘blog’,
  136. ‘name’ => __( ‘Single Post Style’, ‘avia_framework’ ),
  137. ‘desc’ => __( ‘Choose the single post style here.’, ‘avia_framework’ ),
  138. ‘id’ => ‘single_post_style’,
  139. ‘type’ => ‘select’,
  140. ‘std’ => ‘single-big’,
  141. ‘no_first’ => true,
  142. ‘subtype’ => array(
  143. __( ‘Single post with small preview image (featured image)’, ‘avia_framework’ ) => ‘single-small’,
  144. __( ‘Single post with big preview image (featured image)’, ‘avia_framework’ ) => ‘single-big’,
  145. __( ‘Multi Author Blog (displays Gravatar of the article author beside the entry and feature images above)’, ‘avia_framework’ ) => ‘multi-big’
  146. )
  147. );
  148.  
  149. $avia_elements[] = array(
  150. ‘slug’ => ‘blog’,
  151. ‘name’ => __( ‘Related Entries’, ‘avia_framework’ ),
  152. ‘desc’ => __( ‘Choose if and how you want to display your related entries. (Related entries are based on tags. If a post does not have any tags then no related entries will be shown)’, ‘avia_framework’ ),
  153. ‘id’ => ‘single_post_related_entries’,
  154. ‘type’ => ‘select’,
  155. ‘std’ => ‘av-related-style-tooltip’,
  156. ‘no_first’ => true,
  157. ‘subtype’ => array(
  158. __( ‘Show thumbnails and display post title by tooltip’, ‘avia_framework’ ) => ‘av-related-style-tooltip’,
  159. __( ‘Show thumbnail and post title by default’, ‘avia_framework’ ) => ‘av-related-style-full’,
  160. __( ‘Disable related entries’, ‘avia_framework’ ) => ‘disabled’
  161. )
  162. );
  163.  
  164. $avia_elements[] = array(
  165. ‘slug’ => ‘blog’,
  166. ‘name’ => __( ‘Blog meta elements’, ‘avia_framework’ ),
  167. ‘desc’ => __( ‘You can choose to hide some of the default Blog elements here:’, ‘avia_framework’ ),
  168. ‘id’ => ‘blog_widgetdescription_meta’,
  169. ‘type’ => ‘heading’,
  170. ‘nodescription’ => true
  171. );
  172.  
  173. $avia_elements[] = array(
  174. ‘slug’ => ‘blog’,
  175. ‘name’ => __( ‘Blog Post Author’, ‘avia_framework’ ),
  176. ‘desc’ => __( ‘Check to display’, ‘avia_framework’ ),
  177. ‘id’ => ‘blog-meta-author’,
  178. ‘type’ => ‘checkbox’,
  179. ‘std’ => ‘true’,
  180. ‘class’ => ‘av_3col av_col_1’
  181. );
  182.  
  183. $avia_elements[] = array(
  184. ‘slug’ => ‘blog’,
  185. ‘name’ => __( ‘Blog Post Comment Count’, ‘avia_framework’ ),
  186. ‘desc’ => __( ‘Check to display’, ‘avia_framework’ ),
  187. ‘id’ => ‘blog-meta-comments’,
  188. ‘type’ => ‘checkbox’,
  189. ‘std’ => ‘true’,
  190. ‘class’ => ‘av_3col av_col_2’
  191. );
  192.  
  193. $avia_elements[] = array(
  194. ‘slug’ => ‘blog’,
  195. ‘name’ => __( ‘Blog Post Category’, ‘avia_framework’ ),
  196. ‘desc’ => __( ‘Check to display’, ‘avia_framework’ ),
  197. ‘id’ => ‘blog-meta-category’,
  198. ‘type’ => ‘checkbox’,
  199. ‘std’ => ‘true’,
  200. ‘class’ => ‘av_3col av_col_2’
  201. );
  202.  
  203. $avia_elements[] = array(
  204. ‘slug’ => ‘blog’,
  205. ‘name’ => __( ‘Blog Post Date’, ‘avia_framework’ ),
  206. ‘desc’ => __( ‘Check to display’, ‘avia_framework’ ),
  207. ‘id’ => ‘blog-meta-date’,
  208. ‘type’ => ‘checkbox’,
  209. ‘std’ => ‘true’,
  210. ‘class’ => ‘av_3col av_col_1’
  211. );
  212.  
  213. $avia_elements[] = array(
  214. ‘slug’ => ‘blog’,
  215. ‘name’ => __( ‘Blog Post Allowed HTML Tags’, ‘avia_framework’ ),
  216. ‘desc’ => __( ‘Check to display’, ‘avia_framework’ ),
  217. ‘id’ => ‘blog-meta-html-info’,
  218. ‘type’ => ‘checkbox’,
  219. ‘std’ => ‘true’,
  220. ‘class’ => ‘av_3col av_col_2’
  221. );
  222.  
  223. $avia_elements[] = array(
  224. ‘slug’ => ‘blog’,
  225. ‘name’ => __( ‘Blog Post Tags’, ‘avia_framework’ ),
  226. ‘desc’ => __( ‘Check to display’, ‘avia_framework’ ),
  227. ‘id’ => ‘blog-meta-tag’,
  228. ‘type’ => ‘checkbox’,
  229. ‘std’ => ‘true’,
  230. ‘class’ => ‘av_3col av_col_3’
  231. );
  232.  
  233. $avia_elements[] = array(
  234. ‘slug’ => ‘blog’,
  235. ‘type’ => ‘visual_group_end’,
  236. ‘id’ => ‘avia_blog_post_options_end’,
  237. ‘nodescription’ => true
  238. );
  239.  
  240. $avia_elements[] = array(
  241. ‘slug’ => ‘blog’,
  242. ‘type’ => ‘visual_group_start’,
  243. ‘id’ => ‘avia_share_links_start’,
  244. ‘nodescription’ => true
  245. );
  246.  
  247. $desc = __( ‘Check to display’, ‘avia_framework’ );
  248. $link = __( ‘Link’, ‘avia_framework’ );
  249.  
  250. if( ! empty( $avia_config[‘social_share_array’] ) )
  251. {
  252. $avia_elements[] = array(
  253. ‘slug’ => ‘blog’,
  254. ‘name’ => __( ‘Share links at the bottom of your blog post’, ‘avia_framework’ ),
  255. ‘desc’ => __( ‘The theme allows you to display share links to various social networks at the bottom of your blog posts. Check which links you want to display:’, ‘avia_framework’ ),
  256. ‘id’ => ‘blog_social_share’,
  257. ‘type’ => ‘heading’,
  258. ‘nodescription’ => true
  259. );
  260.  
  261. $count = 0;
  262.  
  263. foreach( $avia_config[‘social_share_array’] as $name => $id )
  264. {
  265. $classind = ( $count % 3 ) + 1;
  266.  
  267. if( strlen( $name ) > 15 )
  268. {
  269. if( ‘mail’ == $id )
  270. {
  271. $name = __( ‘E-Mail’, ‘avia_framework’ );
  272. }
  273. else
  274. {
  275. $name = ucfirst( $id ) . ‘ ‘ . $link;
  276. }
  277. }
  278.  
  279. $avia_elements[] = array(
  280. ‘slug’ => ‘blog’,
  281. ‘name’ => $name,
  282. ‘desc’ => $desc,
  283. ‘id’ => ‘share_’ . $id,
  284. ‘type’ => ‘checkbox’,
  285. ‘std’ => ”,
  286. ‘class’ => ‘av_3col av_col_’ . $classind,
  287.  
  288. );
  289.  
  290. $count++;
  291. }
  292. }
  293.  
  294. if( ! empty( $avia_config[‘social_profile_array’] ) )
  295. {
  296. $prof_desc = sprintf( __( ‘If you added Social Profile Links at %s Theme Options -> Social Profiles %s the theme allows you to display these profile links at the bottom of your blog posts.’, ‘avia_framework’ ), ‘‘, ‘‘ );
  297. $prof_desc .= __( ‘Be sure you added a link, otherwise your selection will be ignored.’, ‘avia_framework’ );
  298.  
  299. $avia_elements[] = array(
  300. ‘slug’ => ‘blog’,
  301. ‘name’ => __( ‘Profile links at the bottom of your blog post’, ‘avia_framework’ ),
  302. ‘desc’ => $prof_desc,
  303. ‘id’ => ‘blog_social_profile’,
  304. ‘type’ => ‘heading’,
  305. ‘nodescription’ => true
  306. );
  307.  
  308. $count = 0;
  309.  
  310. foreach( $avia_config[‘social_profile_array’] as $name => $id )
  311. {
  312. $classind = ( $count % 3 ) + 1;
  313.  
  314. if( strlen( $name ) > 15 )
  315. {
  316. $name = strtoupper( $id ) . ‘ ‘ . $link;
  317. }
  318.  
  319. $avia_elements[] = array(
  320. ‘slug’ => ‘blog’,
  321. ‘name’ => $name,
  322. ‘desc’ => $desc,
  323. ‘id’ => ‘share_’ . $id,
  324. ‘type’ => ‘checkbox’,
  325. ‘std’ => ”,
  326. ‘class’ => ‘av_3col av_col_’ . $classind,
  327.  
  328. );
  329.  
  330. $count++;
  331. }
  332.  
  333. }
  334.  
  335. $avia_elements[] = array(
  336. ‘slug’ => ‘blog’,
  337. ‘name’ => __( ‘Share Button Bar Style’, ‘avia_framework’ ),
  338. ‘desc’ => __( ‘Select how to display the share buttons bar’, ‘avia_framework’ ),
  339. ‘id’ => ‘single_post_share_buttons_style’,
  340. ‘type’ => ‘select’,
  341. ‘std’ => ”,
  342. ‘no_first’ => true,
  343. ‘subtype’ => array(
  344. __( ‘Rectangular’, ‘avia_framework’ ) => ”,
  345. __( ‘Rectangular minimal’, ‘avia_framework’ ) => ‘minimal’,
  346. __( ‘Block square’, ‘avia_framework’ ) => ‘av-social-sharing-box-square’,
  347. __( ‘Rounded rectangular’, ‘avia_framework’ ) => ‘av-social-sharing-box-rounded’,
  348. __( ‘Buttons’, ‘avia_framework’ ) => ‘av-social-sharing-box-buttons’,
  349. __( ‘Circle’, ‘avia_framework’ ) => ‘av-social-sharing-box-circle’,
  350. __( ‘Icon’, ‘avia_framework’ ) => ‘av-social-sharing-box-icon’,
  351. __( ‘Icon simple’, ‘avia_framework’ ) => ‘av-social-sharing-box-icon-simple’,
  352. )
  353. );
  354.  
  355. $avia_elements[] = array(
  356. ‘slug’ => ‘blog’,
  357. ‘name’ => __( ‘Share Button Bar Alignment’, ‘avia_framework’ ),
  358. ‘desc’ => __( ‘Select alignment of the share buttons bar’, ‘avia_framework’ ),
  359. ‘id’ => ‘single_post_share_buttons_alignment’,
  360. ‘type’ => ‘select’,
  361. ‘std’ => ”,
  362. ‘no_first’ => true,
  363. ‘required’ => array( ‘single_post_share_buttons_style’, ‘{contains_array}av-social-sharing-box-square;av-social-sharing-box-circle;av-social-sharing-box-icon;av-social-sharing-box-icon-simple’ ),
  364. ‘subtype’ => array(
  365. __( ‘Left’, ‘avia_framework’ ) => ”,
  366. __( ‘Centered’, ‘avia_framework’ ) => ‘av-social-sharing-center’,
  367. __( ‘Right’, ‘avia_framework’ ) => ‘av-social-sharing-right’,
  368. )
  369. );
  370.  
  371. $avia_elements[] = array(
  372. ‘slug’ => ‘blog’,
  373. ‘type’ => ‘visual_group_end’,
  374. ‘id’ => ‘avia_share_links_end’,
  375. ‘nodescription’ => true
  376. );
Advertisement
Add Comment
Please, Sign In to add comment