esc_html__( 'Affiliates for WooCommerce', 'affiliates-for-woocommerce' ),
'plugin_prefix' => 'ddwcaf',
'review_url' => 'https://wordpress.org/support/plugin/affiliates-for-woocommerce/reviews/#new-post',
] );
}
}
/**
* Plugin settings link
*
* @param array $links Links Array.
* @return array $links
*/
public function ddwcaf_plugin_settings_link( $links ) {
ob_start();
?>
|
|
|
'' . esc_html__( 'Support', 'affiliates-for-woocommerce' ) . '',
'documentation' => '' . esc_html__( 'Documentation', 'affiliates-for-woocommerce' ) . '',
'review' => '',
];
$links = array_merge( $links, $row_meta );
}
return $links;
}
}
}
if ( ! class_exists( 'DDWCAF_Init' ) ) {
}
// Load DevDiggers Framework if not loaded already.
add_action( 'plugins_loaded', function() {
if ( ! class_exists( 'DDWCAF_Init' ) ) {
defined( 'DDWCAF_PLUGIN_FILE' ) || define( 'DDWCAF_PLUGIN_FILE', plugin_dir_path( __FILE__ ) );
defined( 'DDWCAF_PLUGIN_URL' ) || define( 'DDWCAF_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
// Load Free version.
DDWCAF_Free_Init::get_instance();
// Load DevDiggers Framework if not loaded already.
if ( ! defined( 'DDFW_LOADED' ) && file_exists( DDWCAF_PLUGIN_FILE . 'devdiggers-framework/init.php' ) ) {
$should_load = true;
if ( ! empty( $_GET['page'] ) ) {
$current_page = $_GET['page'];
$prefix = explode( '-', $current_page )[0];
if ( 0 === strpos( $prefix, 'ddwc' ) || 0 === strpos( $prefix, 'ddwp' ) ) {
$pro_class = strtoupper( $prefix ) . '_Init';
$free_class = strtoupper( $prefix ) . '_Free_Init';
if ( class_exists( $free_class ) && ! class_exists( $pro_class ) && 'ddwcaf' !== $prefix ) {
$should_load = false;
}
}
}
if ( $should_load ) {
require DDWCAF_PLUGIN_FILE . 'devdiggers-framework/init.php';
}
}
}
}, 10 );
// For HPOS Compatibility
add_action( 'before_woocommerce_init', function() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
}
} );
if ( ! function_exists( 'ddwcaf_print_list_empty_state' ) ) {
/**
* Empty state for an admin list, on the framework's block. When a search or filter is set,
* it says nothing matched instead, since the list itself is not empty.
*
* @param array $args Same arguments as ddfw_print_empty_state().
* @return void
*/
function ddwcaf_print_list_empty_state( $args ) {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only check of the list's own filters.
$filtered = array_filter( array_intersect_key( wp_unslash( $_GET ), array_flip( [ 's', 'show', 'affiliate-id', 'affiliate_status', 'from-date', 'end-date', 'payout-id', 'product-id' ] ) ) );
if ( $filtered ) {
$args = [
'title' => __( 'No matching results', 'affiliates-for-woocommerce' ),
'description' => __( 'Nothing matches this search or these filters. Try a wider date range or clear the filters.', 'affiliates-for-woocommerce' ),
'icon' => '',
];
}
ddfw_print_empty_state( $args );
}
}
require_once plugin_dir_path( __FILE__ ) . 'includes/install.php';
register_activation_hook( __FILE__, [ 'DDWCAF_Install', 'ddwcaf_on_plugin_activation' ] );