'wordpress', 'utm_medium' => 'plugin', 'utm_campaign' => 'stackmime-forms', 'utm_content' => sanitize_key( $content ), ), $base ); } /** * A page on stackmime.com (services), tagged the same way as the store links. * * @param string $path Path, e.g. '/website-redesign/' or '/#check'. * @param string $content Where the link sits (utm_content). */ function stackmime_forms_site_url( $path, $content = 'guide' ) { $parts = explode( '#', $path, 2 ); $url = add_query_arg( array( 'utm_source' => 'wordpress', 'utm_medium' => 'plugin', 'utm_campaign' => 'stackmime-forms', 'utm_content' => sanitize_key( $content ), ), 'https://stackmime.com' . $parts[0] ); return isset( $parts[1] ) ? $url . '#' . $parts[1] : $url; } /** * Header with the plugin name, links and tabs. * * @param array $args { * @type string $title Screen title. * @type string $sub One-line description. * @type array $tabs key => array( label, url, count ). * @type string $current Current tab key. * } */ function stackmime_forms_ui_header( $args ) { $args = wp_parse_args( $args, array( 'title' => 'StackMime Forms', 'sub' => '', 'tabs' => array(), 'current' => '', ) ); ?>
StackMIME' ); ?>
array( 'StackMime Forms', __( 'Contact and quote forms with saved entries.', 'stackmime-forms' ) ), 'stackmime-mail' => array( 'StackMime Mail', __( 'SMTP and Gmail sending with an email log.', 'stackmime-forms' ) ), 'stackmime-seo' => array( 'StackMime SEO', __( 'Titles, schema, redirects and a 404 log.', 'stackmime-forms' ) ), 'stackmime-maintenance' => array( 'StackMime Maintenance', __( 'Maintenance and coming soon pages.', 'stackmime-forms' ) ), ); unset( $all['stackmime-forms'] ); $items = array(); foreach ( $all as $slug => $info ) { if ( is_dir( WP_PLUGIN_DIR . '/' . $slug ) ) { continue; } $items[ $slug ] = $info; } if ( ! $items || ! current_user_can( 'install_plugins' ) ) { return; } ?>' . esc_html( $text ) . '
'; } /** * Load the admin styles on this plugin's screens only. * * @param string $url Plugin base URL. */ function stackmime_forms_ui_enqueue( $url ) { wp_enqueue_style( 'stackmime-forms-admin', $url . 'assets/admin/smui.css', array(), STACKMIME_FORMS_VERSION ); add_thickbox(); } /** * Body class for our screens (lets the grey page background match the cards). */ add_filter( 'admin_body_class', function ( $classes ) { $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null; if ( $screen && false !== strpos( (string) $screen->id, 'stackmime-forms' ) ) { $classes .= ' smui-screen'; } return $classes; } ); /** * The "Getting started" screen body. * * @param array $g { * @type string $title Hero heading. * @type string $intro Hero text. * @type array $hero Button: array( label, url ). * @type array $steps List of array( title, text, url, button label ). url may be empty. * @type array $tips List of array( title, text ). * @type array $faq List of array( question, answer ). * @type array $service StackMIME service card: array( title, text, button label, path on stackmime.com ). * } */ function stackmime_forms_ui_guide( $g ) { ?>array() ) ); ?>