PluginProbe
Datafeedr API / 1.4.2
Datafeedr API v1.4.2
1.4.2 1.0.125 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.29 1.0.3 1.0.30 1.0.31 1.0.32 1.0.33 All 181 releases
datafeedr-api / hooks / admin / interface.php

interface.php in Datafeedr API 1.4.2, at hooks/admin/interface.php

68 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined( 'ABSPATH' ) || exit;
4
5 /**
6 * Includes HelpScout Beacon if enabled and if on a Datafeedr-specific page.
7 *
8 * @since 1.0.84
9 */
10 function dfrapi_include_helpscout_beacon() {
11
12 $options = get_option( 'dfrapi_configuration', [] );
13
14 if ( isset( $options['hs_beacon'] ) && 'off' === $options['hs_beacon'] ) {
15 return;
16 }
17
18 if ( ! dfrapi_is_datafeedr_admin_page() ) {
19 return;
20 }
21
22 include_once DFRAPI_PATH . 'js/helpscout-beacon.php';
23 }
24
25 add_action( 'admin_footer', 'dfrapi_include_helpscout_beacon' );
26
27 /**
28 * Add link to Configuration page to action links on Plugins page.
29 *
30 * @param array $links
31 *
32 * @return array
33 */
34 function dfrapi_add_plugin_action_links( array $links ): array {
35 return array_merge(
36 $links,
37 [
38 'config' => sprintf
39 (
40 '<a href="%1$s">%2$s</a>',
41 dfrapi_configuration_page_url(),
42 __( 'Configuration', 'datafeedr-api' )
43 )
44 ]
45 );
46 }
47
48 add_filter( 'plugin_action_links_' . DFRAPI_BASENAME, 'dfrapi_add_plugin_action_links' );
49
50 /**
51 * Add links to Documentation and Contact page to meta row on Plugins page.
52 *
53 * @param array $links
54 * @param string $plugin_file
55 *
56 * @return array
57 */
58 function dfrapi_add_plugin_row_meta( array $links, string $plugin_file ): array {
59 if ( $plugin_file === DFRAPI_BASENAME ) {
60 $links[] = sprintf( '<a href="' . DFRAPI_DOCS_URL . '" target="_blank" rel="noopener nofollow">%s</a>', __( 'Documentation', 'datafeedr-api' ) );
61 $links[] = sprintf( '<a href="' . DFRAPI_HELP_URL . '" target="_blank" rel="noopener nofollow">%s</a>', __( 'Support', 'datafeedr-api' ) );
62 }
63
64 return $links;
65 }
66
67 add_filter( 'plugin_row_meta', 'dfrapi_add_plugin_row_meta', 10, 2 );
68