Modify the function of the plugin with a hook

I just spent 2 days trying to pass / change an argument in the function of a plugin but I haven't had any luck so far. Could someone please show me the right way or the right solution?

I must be able to change value 'cat' => '44' with a shortcode to any other value written in this shortcode for example (search cat="15") would do the 'cat' => '15' in function.

function search() {
    if ( isset( $_REQUEST('swpquery') ) && ! empty( $_REQUEST('swpquery') ) ) {

        $query = sanitize_text_field( $_REQUEST('swpquery') );

    if ( class_exists( 'SearchWP' ) ) {
        // SearchWP powered search
        $posts = $this->searchwp( $query );
        $args = array(
            'post_type'        => 'any',      // We're limiting to a pre-set array of post IDs.
            'post_status'      => 'any',      // We're limiting to a pre-set array of post IDs.
            'post__in'         => $posts,
            'orderby'          => 'post__in',
            'suppress_filters' => true,
        );
    } else {
        // native WordPress search
        $args = array(
            's'           => $query,
            'post_status' => 'publish',
            'cat' => '44',
            'post_type'   => get_post_types( array(
                'public'              => true,
                'exclude_from_search' => false,
            ) ),
        );
    }

    $args('posts_per_page') = $this->get_posts_per_page();

    $args = apply_filters( 'searchwp_live_search_query_args', $args );

    $this->show_results( $args );
}

// Short circuit to keep the overhead of an admin-ajax.php call to a minimum.
die();}

Thank you very much for any help.

magento2 – How to display a message when you don't define a shipping method in magento 2.3 using the aroundEstimateByExtendedAddress plugin?

You want to display a message after certain conditions, how to achieve it?

class ShipmentEstimationPlugin
{
    public function __construct(
        MagentoCustomerModelSession $customerSession

    ) {
        $this->customerSession = $customerSession;

    }

    public function aroundEstimateByExtendedAddress(
        ShipmentEstimationInterface $subject,
        Closure $proceed,
        $cartId,
        MagentoQuoteApiDataAddressInterface $address
    ) {
        $writer = new ZendLogWriterStream(BP . '/var/log/testshipping.log');
        $logger = new ZendLogLogger();
        $logger->addWriter($writer);


       $objectManager = MagentoFrameworkAppObjectManager::getInstance();
       $cart = $objectManager->get('MagentoCheckoutModelCart'); 
       $itemsCollection = $cart->getQuote()->getItemsCollection();
       $itemsVisible = $cart->getQuote()->getAllVisibleItems();
       $items = $cart->getQuote()->getAllItems();
       $product = $objectManager->create('MagentoCatalogModelProduct');

       $brands =  array();
       foreach($items as $item) {
        $loaded_product = $product->load($item->getProductId());
        $product = $product->load($item->getProductId());
        $brand = null;
        $brand=$loaded_product->getResource()->getAttribute('brand')->getFrontend()->getValue($loaded_product);
        $brand = strval($brand);
        $subTotal = $cart->getQuote()->getSubtotal();
        // $items = array($brand);
        array_push($brands, $brand);

        }


        $size = sizeof($brands);
        $logger->info($brands);
        $logger->info($size);
        $pelican = in_array("Pelican",$brands);
        $nanuk = in_array("Nanuk", $brands);
        $other = in_array("Other", $brands);


        $logger->info("Pelican");
        $logger->info($pelican);
        $logger->info("Nanuk");
        $logger->info($nanuk);
        $logger->info("Other");
        $logger->info($other);


        $code=$address->getPostcode();
        $region=$address->getRegionId();
        $logger->info($code);
        $logger->info($region);

        $check = stripos($code, '0') === 1;
        $logger->info(stripos($code, '0') === 1);



        $shippingMethods = $proceed($cartId, $address);

        if ($code) { 
            if ($check ) { 
                foreach ($shippingMethods as $key => $shippingMethod) {
                    if($shippingMethod->getMethodCode() == "freeshipping"){
                        unset($shippingMethods($key));
                    }        
                }
            }
        }

        if ($region) { // Check is regionid exists in request
            $regionid = $region;
            if ($regionid == 69 || $regionid == 72 || $regionid == 73 || $regionid == 75 || $regionid == 78) { 
                foreach ($shippingMethods as $key => $shippingMethod) {
                    if($shippingMethod->getMethodCode() == "freeshipping"){
                        unset($shippingMethods($key));
                    }        
                }
            }
        }

        if( in_array("Pelican",$brands) || in_array("Nanuk",$brands)){
            if($subTotal >= 150){    
                if( in_array("Other", $brands) || in_array("SKB", $brands)) 
                {            
                 if ($regionid == 69 || $regionid == 72 || $regionid == 73 || $regionid == 75 || $regionid == 78 || $check) {                                                                                                           foreach ($shippingMethods as $key => $shippingMethod) {
                            if($shippingMethod->getMethodCode() == "freeshipping"){
                              unset($shippingMethods($key));
                            }        
                        }
                        $logger->info("Pelican & Non Pelican found");
                        $logger->info("You are not eligible for free shipping");

                    }
                    else
                    {

                    foreach ($shippingMethods as $key => $shippingMethod) {
                        if($shippingMethod->getMethodCode() == "freeshipping"){
                            unset($shippingMethods($key));
                        }        
                    }
                    $logger->info("Pelican & Non Pelican found");
                    $logger->info("You may be eligible for free shipping");

//not Working 
 $question = $objectManager->create('MagentoFrameworkMessageManagerInterface');
                    $question->addWarning(__("Warning"));
//not working
                     //Want to display message here 
                    // echo "You may be eligible for free shipping. Contact at websales@productioncase.com for you free quote";


                    }

                }
                else
                {
                    $logger->info("Only Pelican/Nanuk found");
                }            
            }else{
                foreach ($shippingMethods as $key => $shippingMethod) {
                    if($shippingMethod->getMethodCode() == "freeshipping"){
                        unset($shippingMethods($key));
                    }        
                }
            }
        }
        else {   
            foreach ($shippingMethods as $key => $shippingMethod) {
                if($shippingMethod->getMethodCode() == "freeshipping"){
                    unset($shippingMethods($key));
                }        
            }
        }

    return $shippingMethods;

    }

}

multisite – How to share multimedia and page content on multiple sites? Everything I google gives me a plugin solution

I have two questions.

I want to share media and other content like pages on multiple sites.
I use multisite for translation, but some of the content remains the same, and as it is often updated, administrators must do it twice for both websites.
How can I get around this?

2nd question] Is there also a way to synchronize the content?
On the main site, I have domainDOTcom / galeria with photos.
On another subsite, I have domainDOTcom / en / gallery with the same photos.
Is there a way, once i have downloaded the Galeria page from main site, this sub site / en / gallery page is also updated with this content?

When / where would you like to attach other classes to the base class in a WordPress plugin?

I have two plugins that I am currently looking at. Each has a function called plugin_classes which attaches other classes to the base class.

These two plugins have init and hooks the functions.

In the first, the call to $this->plugin_classes() occurs in the hooks function while in the second it is called in the init a function.

In both cases, the hooks functions call the init the functions.

So AFAIK it seems that there is no real difference other than in the plugin using init classes are added slightly after those in square brackets (potentially). Is there something missing?

plugin development – https://infosupplement.com/tinnitus-911 – WordPress Development Stack Exchange

Tinnitus 911, so it cuts just above the elastic. It's just starting to saw, basically I'm wasting the same amount on both sides Ready? Are you serious? Oh my God Ty, I'm doing a really bad job. Oh my God. Oh, it's a hacking job. This is a character assassination. The fairly similar look I think if I were to do this again, I would need a few extra braids because my braids are way too thick for me to hack YES. It's a similar feeling My hair smells good Here, do you want it? I'm calling this serial killer ASMR Okay, so we're here now, so let me see what's going to happen in

Is Tinnitus 911 Scam & Dangerous? READ Reviews

How to change email text of lost password using custom wordpress plugin?

In wordpress, I want to add an additional parameter (ABC) in the password link lost with the key (lost email password).

I have added many hooks.

  1. add_action( 'password_reset', 'password_reset_hook', 10, 2 );

    this hook does not work

  2. add_action( 'wp_loaded', array($this, 'process_user_lost_password' ), 20 );

    when i call the above action, the lost password key is generated and updated in the database.
    Again, the default lost password action is called and also generates a new key and updates for
    database again. So when I deal with an old key, the message "Invalid key" appears. How can i fix it
    problem. How do I stop the triggering of the default mail reset password by programming.
    What is the hook to change the text of the lost password email for wordpress?

  3. add_filter( 'retrieve_password_message', 'my_retrieve_password_message', 10, 4 );

    This filter does not work.

Help me, please.

magento2 – Plugin Before not working

I am trying to understand the functionality of the plugin method. for that i have created a custom module and i have added below the code in di.xml


    
        
    

and the model class code is

namespace AdhikariStudyPluginModel;
class StudyPlugin extends MagentoFrameworkModelAbstractModel
{
    public function getName($name){
            return $name;
    }
}

after that my plugin method code is

namespace AdhikariStudyPluginPluginModel;
class StudyPlugin
{

    public function beforeGetName(AdhikariStudyPluginModelStudyPlugin $subject, $name){
        die('hello');
        return ('(' . 'My name is '.$name . ')');
    }

}

and finally i created a block class and below is the code for that block class.

namespace AdhikariStudyPluginBlockStudyPlugin;
use MagentoFrameworkViewElementTemplate;
class PluginBlock extends Template 
{

    public function __construct(
        TemplateContext $context,
        AdhikariStudyPluginModelStudyPlugin $studyPlugin,
        array $data = ()
    ) {
        parent::__construct($context, $data);
        $this->_studyPlugin = $studyPlugin;

    }

    public function getName($name){
        return $this->_studyPlugin->getName($name);
    }
}

but when I include this block in the home page and call the block function getName (& # 39; hello & # 39;); it does not code before the plugin method. but i call the model class method getName ($ name) and the return value.

can anyone help me understand the workflow or if i make a mistake ..

reactjs – Best practices for plugin structure in webpack grouping

Today we have software that we are trying to port to React with the help of Webpack, but before I start, I want some information for best practices as I only worked on it. with a single entry, previously simple structured applications.

The system is built as modules / plugins (own phrasing, not actual reaction modules) and a "Core project".

Today, the folder structure is as follows:

System root   
  Core
    Core.js   
  Plugins
      Plugin1
        Plugin1.js
      Plugin2
        Plugin2.js

Plugins must keep track of the routing themselves, and I can't rely on Core to know which routes are available. I would also like to have separate entries for each plugin to facilitate long term scalability.

I can, of course, have an entry and in Core.js do import for all plugins etc. but that doesn't allow a lot of scalability and Core.js needs to be aware of all plugins and import all plugins etc.

Can anyone give me some advice on the best way to get ahead with this idea?

[NSFW] DreamyTransexuals.com + WP script license and plugin

Why are you selling this site?

Need money

How is it monetized?

Use of http://exoclick.com/

Does this site come with social media accounts?

Yes, Twitter account with more than 2,000 followers and many tweets

How long does this site take to work?

Very little

What are the challenges of managing this site?

Increase in traffic, deletion of videos deleted from pornhub.com, ….

rest api – Magento 2.2.2 Plugin how to add a custom field in the request API

I created a plugin to listen to the API POST /V1/order/:orderId/refund

and I would like to receive a custom field. I have added a field for tests like: name:('test')

Body FOR EXAMPLE:

{
    "items": (
        {
            "extension_attributes": {},
            "order_item_id": 7,
            "qty": 1
        }
    ),
    "isOnline": false,
    "notify": true,
    "appendComment": true,
    "name": (
      { 
          "test": "ok" 
      }
    ), //THIS IS MY CUSTOM FIELD
    "comment": {
        "extension_attributes": {},
        "comment": "refund has been created",
        "is_visible_on_front": 0
    },
    "arguments": {
        "shipping_amount": 0,
        "adjustment_positive": 0,
        "adjustment_negative": 0,
        "extension_attributes": {
            "return_to_stock_items": ()
        }
    }
}

beforeExecute Method:

...
    /**
     * Create refund for invoice
     *
     * @param int $invoiceId
     * @param MagentoSalesApiDataCreditmemoItemCreationInterface() $items
     * @param bool|null $isOnline
     * @param bool|null $notify
     * @param bool|null $appendComment
     * @param MagentoSalesApiDataCreditmemoCommentCreationInterface|null $comment
     * @param MagentoSalesApiDataCreditmemoCreationArgumentsInterface|null $arguments
     * @param mixed $name
     * @return int
     * @since 100.1.3
     */

    public function beforeExecute (
        MagentoSalesModelRefundOrder $subject,
        $orderId,
        array $items = (),
        $notify = false,
        $appendComment = false,
        MagentoSalesApiDataCreditmemoCommentCreationInterface $comment = null,
        MagentoSalesApiDataCreditmemoCreationArgumentsInterface $arguments = null,
        array $name = ()
    ) {
        print_r($name);die;
      }
...

My custom field name is a table similar to items: but I get an empty array of Response:
s

Anyone, any help appreciated!