Plugin Directory

Changeset 3267218


Ignore:
Timestamp:
04/05/2025 10:19:23 AM (11 months ago)
Author:
hippooo
Message:

v1.0.01

Location:
hippoo-popup/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • hippoo-popup/trunk/app/web-api.php

    r3203303 r3267218  
    22if ( ! defined( 'ABSPATH' ) ) exit;
    33
    4 // Get the settings via REST API
    5 function hippoo_popup_admin_page_get_settings() {
    6     $settings = get_option( 'hippoo_popup_settings', array() );
    7     return rest_ensure_response( $settings );
    8 }
    94
    10 // Update the settings via REST API
    11 function hippoo_popup_admin_page_update_settings( $request ) {
    12     $datas = $request->get_json_params();
    13     if ( ! empty( $datas ) ) {
    14         $settings = get_option( 'hippoo_popup_settings', array() );
    15         foreach ( $datas as $k => $v ) {
    16             $settings[ $k ] = sanitize_text_field( wp_unslash( $v ) );
    17         }
    18         update_option( 'hippoo_popup_settings', $settings );
    19         return rest_ensure_response( __( 'Settings updated successfully.', 'hippoo-popup' ) );
    20     } else {
    21         return rest_ensure_response( __( 'Nothing changed.', 'hippoo-popup' ) );
    22     }
    23 }
     5
  • hippoo-popup/trunk/hippoo-popup.php

    r3203303 r3267218  
    22/**
    33 * Plugin Name: Hippoo Popup
    4  * Version: 1.0.0
     4 * Version: 1.0.1
    55 * Plugin URI: https://Hippoo.app
    66 * Description: The ultimate extension to elevate your store's engagement! With Hippoo Popup, seamlessly integrate captivating popups directly within the Hippoo app, boosting interaction and driving results like never before.
     
    1515define( 'HIPPOO_POPUP_URL', plugins_url( 'hippoo-popup' ) . '/assets' );
    1616include_once( plugin_dir_path( __FILE__ ) . 'app' . DIRECTORY_SEPARATOR . 'web-api.php' );
     17include_once( plugin_dir_path( __FILE__ ) . 'app' . DIRECTORY_SEPARATOR . 'web-api-auth.php' );
    1718
    1819// Load translation files
     
    163164add_action( 'wp_footer', 'hippoo_popup_hook_popup_to_footer', 10 );
    164165
    165 // Register REST API routes
    166 function hippoo_popup_admin_page_register_rest_routes() {
    167     register_rest_route(
    168         'wc/hippoo-popup/v1',
    169         '/settings',
    170         array(
    171             'methods'             => 'GET',
    172             'callback'            => 'hippoo_popup_admin_page_get_settings',
    173             'permission_callback' => function () {
    174                 return current_user_can( 'manage_options' );
    175             },
    176         )
    177     );
    178 
    179     register_rest_route(
    180         'wc/hippoo-popup/v1',
    181         '/settings',
    182         array(
    183             'methods'             => 'PUT',
    184             'callback'            => 'hippoo_popup_admin_page_update_settings',
    185             'permission_callback' => function () {
    186                 return current_user_can( 'manage_options' );
    187             },
    188         )
    189     );
    190 }
    191 add_action( 'rest_api_init', 'hippoo_popup_admin_page_register_rest_routes' );
  • hippoo-popup/trunk/readme.txt

    r3203303 r3267218  
    55Requires at least: 5.3
    66Tested up to: 6.7
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88Text Domain: hippoo-popup
    99License: GPL3
     
    3535== Changelog ==
    3636
     37= 1.0.1 =
     38* Minor updates
     39
    3740= 1.0.0 =
    3841* Initial release.
Note: See TracChangeset for help on using the changeset viewer.