1 <?php
2 3 4 5 6 7 8 9 10
11
12
13 if ( ! defined( 'ABSPATH' ) ) exit;
14
15 16 17 18 19 20
21 function edd_downloads_contextual_help() {
22 $screen = get_current_screen();
23
24 if ( $screen->id != 'download' )
25 return;
26
27 $screen->set_help_sidebar(
28 '<p><strong>' . sprintf( __( 'For more information:', 'edd' ) . '</strong></p>' .
29 '<p>' . sprintf( __( 'Visit the <a href="%s">documentation</a> on the Easy Digital Downloads website.', 'edd' ), esc_url( 'https://easydigitaldownloads.com/documentation/' ) ) ) . '</p>' .
30 '<p>' . sprintf(
31 __( '<a href="%s">Post an issue</a> on <a href="%s">GitHub</a>. View <a href="%s">extensions</a> or <a href="%s">themes</a>.', 'edd' ),
32 esc_url( 'https://github.com/pippinsplugins/Easy-Digital-Downloads/issues' ),
33 esc_url( 'https://github.com/pippinsplugins/Easy-Digital-Downloads' ),
34 esc_url( 'https://easydigitaldownloads.com/extensions/' ),
35 esc_url( 'https://easydigitaldownloads.com/themes/' )
36 ) . '</p>'
37 );
38
39 $screen->add_help_tab( array(
40 'id' => 'edd-download-configuration',
41 'title' => __( 'Download Configuration', 'edd' ),
42 'content' =>
43 '<p>' . __( '<strong>Pricing Options</strong> - Either define a single fixed price, or enable variable pricing. By enabling variable pricing, multiple download options and prices can be configured.', 'edd' ) . '</p>' .
44
45 '<p>' . __( '<strong>File Downloads</strong> - Define download file names and their respsective file URL. Multiple files can be assigned to a single price, or variable prices.', 'edd' ) . '</p>' .
46
47 '<p>' . __( '<strong>File Download Limit</strong> - Define how many times customers are allowed to download their purchased files. Leave at 0 for unlimited. Resending the purchase receipt will permit the customer one additional download if their limit has already been reached.', 'edd' ) . '</p>' .
48
49 '<p>' . __( '<strong>Button Options</strong> - Disable the automatic output the purchase button. If disabled, no button will be added to the download page unless the <code>[purchase_link]</code> shortcode is used.', 'edd' ) . '</p>'
50 ) );
51
52 $screen->add_help_tab( array(
53 'id' => 'edd-product-notes',
54 'title' => __( 'Product Notes', 'edd' ),
55 'content' => '<p>' . __( 'Special notes or instructions for the product. These notes will be added to the purchase receipt, and additionaly may be used by some extensions or themes on the frontend.', 'edd' ) . '</p>'
56 ) );
57
58 $colors = array(
59 'gray', 'pink', 'blue', 'green', 'teal', 'black', 'dark gray', 'orange', 'purple', 'slate'
60 );
61
62 $screen->add_help_tab( array(
63 'id' => 'edd-purchase-shortcode',
64 'title' => __( 'Purchase Shortcode', 'edd' ),
65 'content' =>
66 '<p>' . __( '<strong>Purchase Shortcode</strong> - If the automatic output of the purchase button has been disabled via the Download Configuration box, a shortcode can be used to output the button or link.', 'edd' ) . '</p>' .
67 '<p><code>[purchase_link id="#" price="1" text="Add to Cart" color="blue"]</code></p>' .
68 '<ul>
69 <li><strong>id</strong> - ' . __( 'The ID of a specific download to purchase.', 'edd' ) . '</li>
70 <li><strong>price</strong> - ' . __( 'Whether to show the price on the purchase button. 1 to show the price, 0 to disable it.', 'edd' ) . '</li>
71 <li><strong>text</strong> - ' . __( 'The text to be displayed on the button or link.', 'edd' ) . '</li>
72 <li><strong>style</strong> - ' . __( '<em>button</em> | <em>text</em> - The style of the purchase link.', 'edd' ) . '</li>
73 <li><strong>color</strong> - <em>' . implode( '</em> | <em>', $colors ) . '</em></li>
74 <li><strong>class</strong> - ' . __( 'One or more custom CSS classes you want applied to the button.', 'edd' ) . '</li>
75 </ul>' .
76 '<p>' . sprintf( __( 'For more information, see <a href="%s">using Shortcodes</a> on the WordPress.org Codex or <a href="%s">Easy Digital Downloads Documentation</a>', 'edd' ), 'http://codex.wordpress.org/Shortcode', 'https://easydigitaldownloads.com/docs/display-purchase-buttons-purchase_link/' ) . '</p>'
77 ) );
78
79 do_action( 'edd_downloads_contextual_help', $screen );
80 }
81 add_action( 'load-post.php', 'edd_downloads_contextual_help' );
82 add_action( 'load-post-new.php', 'edd_downloads_contextual_help' );