'); - todo: not yet handled by core } /** * Method fires the activation hook. But only if the plugin is being * activated. The flag is set in the database options table * {@see activation} and is used to determine if the plugin is being * activated. This method removes the flag after it has been used. */ public function fireActivationHook(): void { if (get_option('rss_core_activation_flag', false) === false) { return; } // Get the source page where the activation was triggered from $source = get_option('rss_core_activation_source_page', 'unknown'); // Remove the activation flag so the action doesn't run again. Do it // before the action so its deleted before anything can go wrong. delete_option('rss_core_activation_flag'); delete_option('rss_core_activation_source_page'); // Gives possibility to hook into the activation process do_action('rss_core_activation', $source); // !important } /** * Method that fires on deactivation */ public function deactivation(): void { // Silence is golden } /** * Method that fires on uninstall */ public static function uninstall(): void { // todo - uninstall not yet handled by core. } /** * Register Plugin providers. Providers will add functionality to the * container. These functionalities are lazy loaded for initialization * until its first use. Therefor it is not hooked into an action. * @uses do_action rss_core_providers_loaded */ public function registerProviders(): void { $this->providerManager->register([ ]); } /** * Register Controllers. Hooked into rss_core_features_loaded to make sure * features are available to the Controllers. * @uses do_action rss_core_controllers_loaded * @uses apply_filters rss_core_controller_classes */ public function registerControllers(): void { $controllers = apply_filters('rss_core_controller_classes', [ DashboardController::class, ]); $this->controllerManager->register($controllers); } /** * Register the plugins REST API endpoint instances. Hooked into * rest_api_init to make sure the REST API is available. * @uses do_action rss_core_endpoints_loaded */ public function registerEndpoints(): void { $this->endpointManager->register([ ]); } /** * Fire an action when the plugin is upgraded from one version to another. * Hooked into rss_core_controllers_loaded to make sure Controllers can * hook into rss_core_plugin_version_upgrade. * * @internal Note the starting underscore in the option name. This is to * prevent the option from being deleted when a user logs out. As if * it is a private Really Simple Security Core option. * * @uses do_action rss_core_plugin_version_upgrade */ public function checkForUpgrades(): void { // todo - upgrades not yet handled by core. } } d( 'order-item' ); if ( $data_store->delete_metadata( $item_id, $meta_key, $meta_value, $delete_all ) ) { WC_Cache_Helper::invalidate_cache_group( 'object_' . $item_id ); // Invalidate cache. return true; } return false; } /** * WooCommerce Order Item Meta API - Get term meta. * * @param int $item_id Item ID. * @param string $key Meta key. * @param bool $single Whether to return a single value. (default: true). * * @throws Exception When `WC_Data_Store::load` validation fails. * @return mixed */ function wc_get_order_item_meta( $item_id, $key, $single = true ) { $data_store = WC_Data_Store::load( 'order-item' ); return $data_store->get_metadata( $item_id, $key, $single ); } /** * Get order ID by order item ID. * * @param int $item_id Item ID. * * @throws Exception When `WC_Data_Store::load` validation fails. * @return int */ function wc_get_order_id_by_order_item_id( $item_id ) { $data_store = WC_Data_Store::load( 'order-item' ); return $data_store->get_order_id_by_order_item_id( $item_id ); } https://mathilderommelaere.fr/page-sitemap.xml 2026-04-28T06:13:50+00:00 https://mathilderommelaere.fr/product-sitemap.xml 2025-10-19T19:29:26+00:00 https://mathilderommelaere.fr/product_cat-sitemap.xml 2025-10-19T19:29:26+00:00