8 – Adding a “Like” operator via views query alter for taxonomy term name

I am trying to add a “Like” operator via views query alter for my taxonomy term name. My view is a block setup with a contextual filter set to show all results as shown below.

enter image description here

Then within given pages, I’d like my content editors to be able to input parts of a term name (thus the SQL “Like” operator) to filter a view via the paragraphs view field contextual options field. For example part of a term name would be “Creative Commons” as shown below.

enter image description here

The code I have so far derived from Xdebug is:

use DrupalviewsPluginviewsqueryQueryPluginBase;
use DrupalviewsViewExecutable;


/**
* Implements hook_views_query_alter().
*/
function mymodule_custom_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
  // Define the view display.
  if ($view->current_display === 'remix_icons_nf_block') {
    // Define the taxonomy term name.
    $name = $view->argument("name")->query->fields("taxonomy_term_field_data_name")("field");
    // Add a like operator.
    $view->query->where(1)("conditions")(0)("operator") = 'LIKE';
    // Now query the name using the condition above.
    $view->query->where(1)('conditions')(0)('value') = '%' . $name . '%';
  }
}

However, this does not seem to be working and I am not sure what I am doing wrong.

sharepoint online – Adding newly create group to “Site Permissions” section ( XXX/_layouts/15/user.aspx )

After creating a SharePoint group, you need to assign the permissions to it at site (web) level.

Add a new action ‘Send HTTP request to SharePoint’ and configure the action to use endpoint as below:

/_api/web/roleassignments/addroleassignment(principalid=<GROUPID>, roledefid=1073741827)

roledefid is for Permission Levels which are as follows:

1073741829 – Full Control

073741827 – Contribute

1073741826 – Read

<GroupID> is the id of the group.

Reference: SharePoint Group Operations in Microsoft Flow

power automate – Adding newly create site to “Site Permissions” section ( XXX/_layouts/15/user.aspx )

Hope you are all doing well.

I managed to use Power Automate to create SP groups and add users to them using the HTTP request action.

The problem i have is the newly created groups are created at the “root” (in People and Groups section) level but not in the site in the “Site Permissions” section so user that i add to the group still do not have access to the site.

I created a flow that adds the group(s) to “site Pages” , “Site assets” and to the specific libraries but they don’t have access to the site itself since the groups are not in “Site Permissions”.

Does anyone know how to add a newly created group to “Site Permissions” ?

Thanks a lot in advance !!

php – Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?

Is this a proper way to load CSS files into my WordPress child theme?

add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
add_action( 'wp_enqueue_scripts', 'case_studies_styles' );
add_action( 'wp_enqueue_scripts', 'about_styles' );

function my_theme_enqueue_styles() {
    wp_enqueue_style( 'child-style', get_stylesheet_uri(),
        array( 'parenthandle' ), 
        wp_get_theme()->get('Version') // this only works if you have Version in the style header
    );
}

function case_studies_styles() {
    wp_enqueue_style( 'child-casestudies', get_stylesheet_directory_uri() . '/casestudies.css', array(), rand());
}

function about_styles() {
    wp_enqueue_style( 'child-about', get_stylesheet_directory_uri() . '/about.css', array(), rand());
}

I’m asking because I’ve asked some people to try to load my site, and some of them don’t get the stylesheets at all and just get the blank HTML code.

Also, in the beginning of all CSS files, I have this beginning. Every CSS file has a different version (1.2,1.1,1.0)

/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Template:     generatepress
 Version:      1.2
*/

pathfinder 2e – Fantasy Grounds – Adding different attacks with one weapon

In the Fantasy grounds software: I am playing a ranger in PF2e and I am trying to understand how to apply my Hunter’s Edge: Flurry ability to weapons I own. I’ve imported a weapon into my inventory and it shows up in my action’s tab no problem. However since I’m looking to use this edge ability it doesn’t necessarily apply to all foes that I am fighting equally.
So how do I apply two weapon-actions with different bonuses under my actions tab? and most importantly how do I link BOTH to the associated weapon without doing something silly like adding a “fake” weapon in my inventory?

You can see in the image that figured out how to add a second action, but it is not actively linked to the appropriate weapon.
enter image description here

Alternately, is there just some toggle I can switch on and off to apply modifiers on the fly?

Adding taxonomy term to a group

I do not think that there is a way to do that unless I do not understand the question correctly.

Group (Types) are meant to be used as content types and thus you can not attach taxonomy terms directly to them.
Groups are meant to be used as nodes. If you want all the groups in a specific group type to belong to certain taxonomy term then you can maybe work something out with the default value of the reference field.

Now concerning your question specifically, i would first check if there is any mistake in the view’s configuration. If I get this right, you wish to display groups that belong to terms A.term and B.term so your are probably using the combined filter. Could you share your view configuration, in order to further examine your issue?

plugins – WordPress Add Media problem with adding media description in wp_editor() when used in bootstrap modal

I am working in a plugin that uses wp_editor() for the text editor and has Add Media button. In my plugin, I have used bootstrap modal to popup a form with the text editor created using wp_editor(). When I click on Add Media to upload an image, I can upload the image but cannot input descriptions like Alt Text, Title or Other description. The textbox does not even get selected and seems to be disabled. Can somebody help me?

wp_editor( $content, $editor_id, $settings);

automation – Automate adding members to sharepoint site (user needs to be in owner group of 22 collections)

Im the sca for 20+ collections in sp2013 on-prem. I frequently have to add a new person as owner to all 20+ collections. I’d like to automate this process, or at least find a way to shave off some of the clicking around. I was thinking of experimenting with browser automation / python. All ideas welcomed. Thanks!

sharepoint online – Restrict user from adding more than one entry a day in calendar list

I am quite new to SharePoint development and am facing an issue in creating a custom calendar list allowing only one entry per user per day with entry only for mode of work (i.e. from home/office etc).

This is actually an employee timesheet. I am using SharePoint online and have no access to InfoPath forms or SharePoint Designer. I got one JavaScript code from: Limit only one entry per day per user in sharepoint list which I tried embedding in script editor, but its not working and showing no errors as such.

Can anyone help me out?

Here’s the code:

var NameSpace = window.NameSpace || {};
var ItemCreation = NameSpace.ItemCreation || {};
ItemCreation.UserName = '';
ItemCreation.ListName = 'Timesheet';
var newListItem = '';


ItemCreation.CreatingItem = (function () {

    CreateItem = function() {

        var clientContext = new SP.ClientContext.get_current();
        /* Get current web */
        var oWeb = clientContext.get_web();

        /* Get list by title */
        var oList = oWeb.get_lists().getByTitle(ItemCreation.ListName);

        /* Create new object for list item creation */
        //
        var oListItemCreationInfo = new SP.ListItemCreationInformation();
        newListItem = oList.addItem(oListItemCreationInfo);

        newListItem.set_item('Mode of Work');

        newListItem.update();
        clientContext.load(newListItem); 
        clientContext.executeQueryAsync(onSuccess, onFailure);

    },

Validate = function() {

        var clientContext = new SP.ClientContext.get_current(),
            web = clientContext.get_web(),
            list = web.get_lists().getByTitle(ItemCreation.ListName),
            camlQuery = new SP.CamlQuery();
            camlQuery.set_viewXml('<View><Query><Where><And><Eq><FieldRef Name="Employee Name" /><Value Type="User">"+ ItemCreation.currentUser +"</Value></Eq><Eq><FieldRef Name="Date" /><Value Type="Calculated">" + ItemCreation.Date + "</Value></Eq></And></Where></Query></View>');

        ItemCreation.Item = list.getItems(camlQuery);
        clientContext.load(ItemCreation.Item); 
        clientContext.executeQueryAsync(onValidateSuccess, onFailure);
    },

    onValidateSuccess = function() {
        if (ItemCreation.Item.get_count() > 0) {
            alert("You can not create more than one item in a day");
        }
        else {
            CreateItem();
        }
    },

    getCurrentUser = function () {
        try {
            var clientContext = new SP.ClientContext.get_current();
            var tempcurrentUser = clientContext.get_web().get_currentUser();
            clientContext.load(tempcurrentUser); 
            clientContext.executeQueryAsync(function () {
                var index = tempcurrentUser.get_loginName().indexOf('|') + 1;
                ItemCreation.currentUser = tempcurrentUser.get_loginName().substring(index);


                Validate();
            }, onFailure);
        }
        catch (err) {
            onFailure();
        }
    },


    onSuccess = function() {
        alert("Success");
    },

    onFailure = function() {
        alert("Error");
    }



    return {
getCurrentUser: getCurrentUser
    };

}());


$(document).ready(function () {
    
    SP.SOD.executeFunc('SP.js', 'SP.ClientContext', function () {
        SP.SOD.executeFunc('user', 'SP.UserProfiles', function () {
            ItemCreation.CreatingItem.getCurrentUser();
console.log("Script loaded");
        });
    });
});

P.S. : The console output inside the document.ready() function is also not displayed.

Adding events to shared calendars

If I add an event to a shared Outlook calendar on outlook.office.com, and then add myself as an attendee to that event, my time is not marked as Busy in my calendar.

I’ve been fixing this by duplicating the event and adding the copy to my own calendar, but surely there’s an easier way to make sure my time is blocked out?