0 ); } } /** * Register shortcodes */ function snax_register_shortcodes() { add_shortcode( 'snax_content', 'snax_content_shortcode' ); } /** * Disable Snax activation in the Network Admin Plugins list table * * @param array $actions An array of plugin action links. * @param string $plugin_file Path to the plugin file relative to the plugins directory. * @param array $plugin_data An array of plugin data. * @param string $context The plugin context. Defaults are 'All', 'Active', * 'Inactive', 'Recently Activated', 'Upgrade', * 'Must-Use', 'Drop-ins', 'Search'. * * @return array */ function snax_network_admin_plugin_action_links( $actions, $plugin_file, $plugin_data, $context ) { if ( $plugin_file === snax()->basename ) { $actions['activate'] = '

'. __( 'Network activation disabled. Activate this plugin in a single site context .', 'snax' ) . '

'; } return $actions; } /** * Return full variable name ready to use in url * * @param string $name Base name of variable. * @param string $glue Glue string. * * @return string Prefix for url variables */ function snax_get_url_var( $name, $glue = '_' ) { $prefix = snax_get_url_var_prefix(); // Suffix with $glue. if ( ! empty( $prefix ) ) { $prefix = rtrim( $prefix, $glue ) . $glue; } return $prefix . $name; } function snax_get_iso_8601_utc_offset() { $offset = get_option( 'gmt_offset' ); $hours = (int) $offset; $minutes = abs( ( $offset - (int) $offset ) * 60 ); return sprintf( '%+03d:%02d', $hours, $minutes ); } function snax_modify_http_headers() { // Disable on frontend submission pages. $nocache_headers = function_exists( 'snax_is_frontend_submission_page' ) && snax_is_frontend_submission_page(); if ( apply_filters( 'snax_send_nocache_headers', $nocache_headers ) ) { header( 'Cache-Control: max-age=0, private, no-cache, no-store, must-revalidate', true ); } }