shortcode-vc-wp-posts.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3. die( '-1' );
  4. }
  5. return array(
  6. 'name' => 'WP ' . esc_html__( 'Recent Posts' ),
  7. 'base' => 'vc_wp_posts',
  8. 'icon' => 'icon-wpb-wp',
  9. 'category' => esc_html__( 'WordPress Widgets', 'js_composer' ),
  10. 'class' => 'wpb_vc_wp_widget',
  11. 'weight' => - 50,
  12. 'description' => esc_html__( 'The most recent posts on your site', 'js_composer' ),
  13. 'params' => array(
  14. array(
  15. 'type' => 'textfield',
  16. 'heading' => esc_html__( 'Widget title', 'js_composer' ),
  17. 'param_name' => 'title',
  18. 'description' => esc_html__( 'What text use as a widget title. Leave blank to use default widget title.', 'js_composer' ),
  19. 'value' => esc_html__( 'Recent Posts' ),
  20. ),
  21. array(
  22. 'type' => 'textfield',
  23. 'heading' => esc_html__( 'Number of posts', 'js_composer' ),
  24. 'description' => esc_html__( 'Enter number of posts to display.', 'js_composer' ),
  25. 'param_name' => 'number',
  26. 'value' => 5,
  27. 'admin_label' => true,
  28. ),
  29. array(
  30. 'type' => 'checkbox',
  31. 'heading' => esc_html__( 'Display post date?', 'js_composer' ),
  32. 'param_name' => 'show_date',
  33. 'value' => array( esc_html__( 'Yes', 'js_composer' ) => true ),
  34. 'description' => esc_html__( 'If checked, date will be displayed.', 'js_composer' ),
  35. ),
  36. array(
  37. 'type' => 'el_id',
  38. 'heading' => esc_html__( 'Element ID', 'js_composer' ),
  39. 'param_name' => 'el_id',
  40. 'description' => sprintf( esc_html__( 'Enter element ID (Note: make sure it is unique and valid according to %sw3c specification%s).', 'js_composer' ), '<a href="https://www.w3schools.com/tags/att_global_id.asp" target="_blank">', '</a>' ),
  41. ),
  42. array(
  43. 'type' => 'textfield',
  44. 'heading' => esc_html__( 'Extra class name', 'js_composer' ),
  45. 'param_name' => 'el_class',
  46. 'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
  47. ),
  48. ),
  49. );