Guest User

Untitled

a guest
Dec 8th, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.41 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.  
  47.  
  48. $avia_config['social_share_array'] = array(
  49. 'Facebook' => 'facebook',
  50. 'Twitter' => 'twitter',
  51. 'WhatsApp' => 'whatsapp',
  52. 'Pinterest' => 'pinterest',
  53. 'Reddit' => 'reddit',
  54. 'LinkedIn' => 'linkedin',
  55. 'Tumblr' => 'tumblr',
  56. 'Vk' => 'vk',
  57. 'Yelp' => 'yelp',
  58. __( 'Special: Email Icon (add your own URL to link to a contact form)', 'avia_framework' ) => 'mail'
  59. );
  60.  
  61. /**
  62. * @since 4.8.4.1
  63. * @param array $avia_config['social_share_array']
  64. * @return array
  65. */
  66. $avia_config['social_share_array'] = apply_filters( 'avf_social_share_array_options', $avia_config['social_share_array'] );
  67.  
  68.  
  69. $avia_config['social_profile_array'] = array_diff( $avia_config['social_icon_array'], $avia_config['social_share_array'] );
  70.  
  71.  
  72.  
  73. $avia_elements[] = array(
  74. 'slug' => 'blog',
  75. 'name' => __( 'Blog Styling', 'avia_framework' ),
  76. 'desc' => __( 'Choose the blog styling here.', 'avia_framework' ),
  77. 'id' => 'blog_global_style',
  78. 'type' => 'select',
  79. 'std' => '',
  80. 'no_first' => true,
  81. 'subtype' => array(
  82. __( 'Default (Business)', 'avia_framework' ) => '',
  83. __( 'Elegant', 'avia_framework' ) => 'elegant-blog',
  84. __( 'Modern Business', 'avia_framework' ) => 'elegant-blog modern-blog',
  85. )
  86. );
  87.  
  88. $avia_elements[] = array(
  89. 'slug' => 'blog',
  90. 'name' => __( 'Blog Layout', 'avia_framework' ),
  91. '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' ),
  92. 'id' => 'blog_style',
  93. 'type' => 'select',
  94. 'std' => 'single-small',
  95. 'no_first' => true,
  96. 'subtype' => array(
  97. __( 'Multi Author Blog (displays Gravatar of the article author beside the entry and feature images above)', 'avia_framework' ) => 'multi-big',
  98. __( 'Single Author, small preview Pic (no author picture is displayed, feature image is small)', 'avia_framework' ) => 'single-small',
  99. __( 'Single Author, big preview Pic (no author picture is displayed, feature image is big)', 'avia_framework' ) => 'single-big',
  100. __( 'Grid Layout', 'avia_framework' ) => 'blog-grid',
  101. __( 'List Layout - Simple (Title and meta information only)', 'avia_framework' ) => 'bloglist-simple',
  102. __( 'List Layout - Compact (Title and icon only)', 'avia_framework' ) => 'bloglist-compact',
  103. __( 'List Layout - Excerpt (Title, meta information and excerpt only)', 'avia_framework' ) => 'bloglist-excerpt',
  104. __( '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',
  105. )
  106. );
  107.  
  108.  
  109. $avia_elements[] = array(
  110. 'slug' => 'blog',
  111. 'type' => 'visual_group_start',
  112. 'id' => 'avia_blog_post_options_start',
  113. 'nodescription' => true
  114. );
  115.  
  116.  
  117. $avia_elements[] = array(
  118. 'slug' => 'blog',
  119. 'name' => __( 'Single Post Options', 'avia_framework' ),
  120. 'desc' => __( 'Here you can set options that affect your single blog post layout', 'avia_framework' ),
  121. 'id' => 'blog_widgetdescription',
  122. 'type' => 'heading',
  123. 'nodescription' => true
  124. );
  125.  
  126. $avia_elements[] = array(
  127. 'slug' => 'blog',
  128. 'name' => __( 'Single Post Navigation', 'avia_framework' ),
  129. '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' ),
  130. 'id' => 'disable_post_nav',
  131. 'type' => 'select',
  132. 'no_first' => true,
  133. 'std' => '',
  134. 'subtype' => array(
  135. __( 'Enable post navigation', 'avia_framework' ) => '',
  136. __( 'Disable post navigation', 'avia_framework' ) => 'disable_post_nav',
  137. __( 'Loop post navigation', 'avia_framework' ) => 'loop_post_nav'
  138. )
  139. );
  140.  
  141. $avia_elements[] = array(
  142. 'slug' => 'blog',
  143. 'name' => __( 'Single Post Style', 'avia_framework' ),
  144. 'desc' => __( 'Choose the single post style here.', 'avia_framework' ),
  145. 'id' => 'single_post_style',
  146. 'type' => 'select',
  147. 'std' => 'single-big',
  148. 'no_first' => true,
  149. 'subtype' => array(
  150. __( 'Single post with small preview image (featured image)', 'avia_framework' ) => 'single-small',
  151. __( 'Single post with big preview image (featured image)', 'avia_framework' ) => 'single-big',
  152. __( 'Multi Author Blog (displays Gravatar of the article author beside the entry and feature images above)', 'avia_framework' ) => 'multi-big'
  153. )
  154. );
  155.  
  156.  
  157.  
  158. $avia_elements[] = array(
  159. 'slug' => 'blog',
  160. 'name' => __( 'Related Entries', 'avia_framework' ),
  161. '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' ),
  162. 'id' => 'single_post_related_entries',
  163. 'type' => 'select',
  164. 'std' => 'av-related-style-tooltip',
  165. 'no_first' => true,
  166. 'subtype' => array(
  167. __( 'Show thumbnails and display post title by tooltip', 'avia_framework' ) => 'av-related-style-tooltip',
  168. __( 'Show thumbnail and post title by default', 'avia_framework' ) => 'av-related-style-full',
  169. __( 'Disable related entries', 'avia_framework' ) => 'disabled'
  170. )
  171. );
  172.  
  173. $avia_elements[] = array(
  174. 'slug' => 'blog',
  175. 'name' => __( 'Blog Meta Elements', 'avia_framework' ),
  176. 'desc' => __( 'You can choose to show or hide some of the default blog meta elements here:', 'avia_framework' ),
  177. 'id' => 'blog_hide_meta_elements',
  178. 'type' => 'heading',
  179. 'nodescription' => true
  180. );
  181.  
  182.  
  183. $avia_elements[] = array(
  184. 'slug' => 'blog',
  185. 'name' => __( 'Blog Post Author', 'avia_framework' ),
  186. 'desc' => __( 'Check to display', 'avia_framework' ),
  187. 'id' => 'blog-meta-author',
  188. 'type' => 'checkbox',
  189. 'std' => 'true',
  190. 'class' => 'av_3col av_col_1'
  191. );
  192.  
  193.  
  194. $avia_elements[] = array(
  195. 'slug' => 'blog',
  196. 'name' => __( 'Blog Post Comment Count', 'avia_framework' ),
  197. 'desc' => __( 'Check to display', 'avia_framework' ),
  198. 'id' => 'blog-meta-comments',
  199. 'type' => 'checkbox',
  200. 'std' => 'true',
  201. 'class' => 'av_3col av_col_2'
  202. );
  203.  
  204. $avia_elements[] = array(
  205. 'slug' => 'blog',
  206. 'name' => __( 'Blog Post Category', 'avia_framework' ),
  207. 'desc' => __( 'Check to display', 'avia_framework' ),
  208. 'id' => 'blog-meta-category',
  209. 'type' => 'checkbox',
  210. 'std' => 'true',
  211. 'class' => 'av_3col av_col_3'
  212. );
  213.  
  214. $avia_elements[] = array(
  215. 'slug' => 'blog',
  216. 'name' => __( 'Blog Post Date', 'avia_framework' ),
  217. 'desc' => __( 'Check to display', 'avia_framework' ),
  218. 'id' => 'blog-meta-date',
  219. 'type' => 'checkbox',
  220. 'std' => 'true',
  221. 'class' => 'av_3col av_col_1'
  222. );
  223.  
  224.  
  225. $avia_elements[] = array(
  226. 'slug' => 'blog',
  227. 'name' => __( 'Blog Post Allowed HTML Tags', 'avia_framework' ),
  228. 'desc' => __( 'Check to display', 'avia_framework' ),
  229. 'id' => 'blog-meta-html-info',
  230. 'type' => 'checkbox',
  231. 'std' => 'true',
  232. 'class' => 'av_3col av_col_2'
  233. );
  234.  
  235. $avia_elements[] = array(
  236. 'slug' => 'blog',
  237. 'name' => __( 'Blog Post Tags', 'avia_framework' ),
  238. 'desc' => __( 'Check to display', 'avia_framework' ),
  239. 'id' => 'blog-meta-tag',
  240. 'type' => 'checkbox',
  241. 'std' => 'true',
  242. 'class' => 'av_3col av_col_3'
  243. );
  244.  
  245.  
  246. $avia_elements[] = array(
  247. 'slug' => 'blog',
  248. 'type' => 'visual_group_end',
  249. 'id' => 'avia_blog_post_options_end',
  250. 'nodescription' => true
  251. );
  252.  
  253. $avia_elements[] = array(
  254. 'slug' => 'blog',
  255. 'type' => 'visual_group_start',
  256. 'id' => 'avia_share_links_start',
  257. 'nodescription' => true
  258. );
  259.  
  260.  
  261.  
  262. $desc = __( 'Check to display', 'avia_framework' );
  263. $link = __( 'Link', 'avia_framework' );
  264.  
  265. if( ! empty( $avia_config['social_share_array'] ) )
  266. {
  267. $avia_elements[] = array(
  268. 'slug' => 'blog',
  269. 'name' => __( 'Share Links At The Bottom Of Your Blog Post', 'avia_framework' ),
  270. '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' ),
  271. 'id' => 'blog_social_share',
  272. 'type' => 'heading',
  273. 'nodescription' => true
  274. );
  275.  
  276. $count = 0;
  277.  
  278. foreach( $avia_config['social_share_array'] as $name => $id )
  279. {
  280. $classind = ( $count % 3 ) + 1;
  281.  
  282. if( strlen( $name ) > 15 )
  283. {
  284. if( 'mail' == $id )
  285. {
  286. $name = __( 'E-Mail', 'avia_framework' );
  287. }
  288. else
  289. {
  290. $name = ucfirst( $id ) . ' ' . $link;
  291. }
  292. }
  293.  
  294. $avia_elements[] = array(
  295. 'slug' => 'blog',
  296. 'name' => $name,
  297. 'desc' => $desc,
  298. 'id' => 'share_' . $id,
  299. 'type' => 'checkbox',
  300. 'std' => '',
  301. 'class' => 'av_3col av_col_' . $classind,
  302.  
  303. );
  304.  
  305. $count++;
  306. }
  307. }
  308.  
  309. if( ! empty( $avia_config['social_profile_array'] ) )
  310. {
  311. $prof_desc = sprintf( __( 'If you added Social Profile Links at %s Theme Options -&gt; Social Profiles %s the theme allows you to display these profile links at the bottom of your blog posts.', 'avia_framework' ), '<a href="#goto_social" target="_blank">', '</a>' );
  312. $prof_desc .= __( 'Be sure you added a link, otherwise your selection will be ignored.', 'avia_framework' );
  313.  
  314. $avia_elements[] = array(
  315. 'slug' => 'blog',
  316. 'name' => __( 'Profile Links At The Bottom Of Your Blog Post', 'avia_framework' ),
  317. 'desc' => $prof_desc,
  318. 'id' => 'blog_social_profile',
  319. 'type' => 'heading',
  320. 'nodescription' => true
  321. );
  322.  
  323. $count = 0;
  324.  
  325. foreach( $avia_config['social_profile_array'] as $name => $id )
  326. {
  327. $classind = ( $count % 3 ) + 1;
  328.  
  329. if( strlen( $name ) > 15 )
  330. {
  331. $name = strtoupper( $id ) . ' ' . $link;
  332. }
  333.  
  334. $avia_elements[] = array(
  335. 'slug' => 'blog',
  336. 'name' => $name,
  337. 'desc' => $desc,
  338. 'id' => 'share_' . $id,
  339. 'type' => 'checkbox',
  340. 'std' => '',
  341. 'class' => 'av_3col av_col_' . $classind,
  342.  
  343. );
  344.  
  345. $count++;
  346. }
  347.  
  348. }
  349.  
  350.  
  351. $avia_elements[] = array(
  352. 'slug' => 'blog',
  353. 'name' => __( 'Share Button Bar Style', 'avia_framework' ),
  354. 'desc' => __( 'Select how to display the share buttons bar', 'avia_framework' ),
  355. 'id' => 'single_post_share_buttons_style',
  356. 'type' => 'select',
  357. 'std' => '',
  358. 'no_first' => true,
  359. 'subtype' => array(
  360. __( 'Rectangular', 'avia_framework' ) => '',
  361. __( 'Rectangular minimal', 'avia_framework' ) => 'minimal',
  362. __( 'Block square', 'avia_framework' ) => 'av-social-sharing-box-square',
  363. __( 'Rounded rectangular', 'avia_framework' ) => 'av-social-sharing-box-rounded',
  364. __( 'Buttons', 'avia_framework' ) => 'av-social-sharing-box-buttons',
  365. __( 'Circle', 'avia_framework' ) => 'av-social-sharing-box-circle',
  366. __( 'Icon', 'avia_framework' ) => 'av-social-sharing-box-icon',
  367. __( 'Icon simple', 'avia_framework' ) => 'av-social-sharing-box-icon-simple',
  368. )
  369. );
  370.  
  371. $avia_elements[] = array(
  372. 'slug' => 'blog',
  373. 'name' => __( 'Share Button Bar Alignment', 'avia_framework' ),
  374. 'desc' => __( 'Select alignment of the share buttons bar', 'avia_framework' ),
  375. 'id' => 'single_post_share_buttons_alignment',
  376. 'type' => 'select',
  377. 'std' => '',
  378. 'no_first' => true,
  379. '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' ),
  380. 'subtype' => array(
  381. __( 'Left', 'avia_framework' ) => '',
  382. __( 'Centered', 'avia_framework' ) => 'av-social-sharing-center',
  383. __( 'Right', 'avia_framework' ) => 'av-social-sharing-right',
  384. )
  385. );
  386.  
  387. $avia_elements[] = array(
  388. 'slug' => 'blog',
  389. 'type' => 'visual_group_end',
  390. 'id' => 'avia_share_links_end',
  391. 'nodescription' => true
  392. );
  393.  
  394.  
  395.  
Advertisement
Add Comment
Please, Sign In to add comment