zeusdx
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Hi!
I developed my own add-on, here’s the code:
<?php /** * Plugin Name: Product Unique ID * Description: Adds a Custom Field for Product Unique ID * Version: 1.0.0 * Author: Marios A. Toparopoulos * Author URI: https://www.web-coders.net * Text Domain: puid * WC requires at least: 3.4.0 * WC tested up to: 3.4.2 */ // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Display the custom text field * @since 1.0.0 */ function puid_field() { global $post; $args = array( 'id' => 'product_unique_id', 'name' => 'product_unique_id', 'label' => 'Product Unique ID', 'type' => 'text', 'placeholder' => 'Automatically Gets Filled', 'class' => 'short puid-field', 'desc_tip' => true, 'description' => 'If value empty, on save will be replaced with post-id', 'custom_attributes' => array ( 'readonly' => 'readonly', ), ); woocommerce_wp_text_input( $args ); } add_action( 'woocommerce_product_options_general_product_data', 'puid_field' ); /** * Save the custom field * @since 1.0.0 */ function puid_save_field( $post_id ) { global $post; $product = wc_get_product( $post_id ); $value = $_POST['product_unique_id']; if (strlen($value) == 0 ): $title = $post->ID; else: $title = $value; endif; $product->update_meta_data( 'product_unique_id', sanitize_text_field( $title ) ); $product->save(); } add_action( 'woocommerce_process_product_meta', 'puid_save_field' );
I figured it out.
I was using a role that was created by a different plugin called User Role Editor
and Members & User Role Editor are not compatible.This is my robots.txt
User-agent: * Disallow: /background-2/ Disallow: /background/ Disallow: /blog/ Disallow: /author/ Disallow: /hestia-front/ Disallow: /cookie-policy/ Disallow: /logo Disallow: /logo/ Disallow: /isologismoi/ Disallow: /αρχικ?/wind-2/ Disallow: /cropped-elans-square-transparent-png/ Disallow: /αρχικ?/wind/ Disallow: /wp-content/ Disallow: /error-404/ Disallow: /wp-content/uploads/2018/05
Is it “Disallow:” or “Disallow” with or without semicolon?
Viewing 3 replies - 1 through 3 (of 3 total)