hooks – 404 Not displayed on custom modules – Drupal 7

I have a problem with the load pages of my custom module that do not exist. For example, in my implementation of hook_menu, I define a path for & # 39; login & # 39 ;. However, if I login & asdfdsa & # 39; in the URL, the login page will still be loaded instead of leading to a 404. Here is a part of the hook_menu:

// implements hook_menu(), defines custom URL routing
function my_account_menu() {
  // anonymous only pages (login/forgot password)
  $items('login') = array(
    'title' => 'Customer Login',
    'page callback'    => 'drupal_get_form',
    'page arguments'   => array('my_account_login_form'),
    'access callback' => 'user_is_anonymous',
    'type' => MENU_CALLBACK
  );

...

I'm not sure what's going on here, whether it's about implementing hook_menu, or maybe there's something else in the module that could cause this problem.

Sharepoint Designer – Create a custom list

There are already many questions and answers about this kind of question. Like this one, for example. You can also search other questions tagged with the "Great List" tag to understand why it is not advisable to have too many items in a list. There is a lot of information on the list borders, here is another one.

For example, where I work, we hold the limit of 5,000 articles. But other people say other things.

In terms of annual metadata, using the same list for 2020 does not hurt you assuming new items are generated at a similar rate. If you were at 2,500 for 2019, I would create a new list for 2020 to stay within the limit of 5,000 articles. If you only have 1000 articles per year, your current list can be safely used for the next 4 years.

Custom Post Types – WP CPT template not found if another CPT is active / public = true

I have 2 custom post types in my WordPress theme and have never had any problems when both are set to.

'public' => 'true'

However, on that occasion, I cleared the cache and still did not succeed if I set one to true and the other refused to load the template and I got a 404 error.

I looked through the code and see no errors.

add_action("init", "custom_post_type_menu_wp_admin");
function custom_post_type_menu_wp_admin() {

register_post_type('developments', 
    array(
        'label' => __('Developments','templatic'),
        'labels' => array(  
            'name' => __('Developments','templatic'),
            'singular_name' => __('Developments','templatic'),
            'add_new' => __('Add Developments','templatic'),
            'add_new_item'=> __('Add New Developments','templatic'),
            'edit' => __('Edit','templatic'),
            'edit_item'=> __('Edit Developments','templatic'),
            'new_item' => __('New Developments','templatic'),
            'view_item' => __('View Developments','templatic'),
            'search_items' => __('Search Developments','templatic'),
            'not_found' => __('No Developments','templatic'),
            'not_found_in_trash'=> __('No Developments found in trash','templatic')   
        ),
        'public'            => true,
        'can_export'        => true,
        'show_ui'           => true,
        '_builtin'          => false,
        '_edit_link'        => 'post.php?post=%d',
        'capability_type'   => 'post',
        'menu_icon'         => 'dashicons-hammer',
        'hierarchical'      => false,
        'rewrite'           => array(
                                        "slug" => "developments",
                                        "with_front" => false
                                    ),
        'query_var'         => "true",
        'supports'          => array(   
                                        'title'
                                    ),
        'show_in_nav_menus' => true
    )
); 

register_post_type('house_types', 
    array(
            'label' => __('House Types','templatic'),
            'labels' => array(  'name' => __('House Types','templatic'),
            'singular_name' => __(
            'House Types','templatic'),
            'add_new' => __('Add House Types','templatic'),
            'add_new_item'=> __('Add New House Types','templatic'),
            'edit' => __('Edit','templatic'),
            'edit_item'=> __('Edit House Types','templatic'),
            'new_item' => __('New House Types','templatic'),
            'view_item' => __('View House Types','templatic'),
            'search_items' => __('Search House Types','templatic'),
            'not_found' => __('No House Types','templatic'),
            'not_found_in_trash'=> __('No House Types found in trash','templatic')   
        ),
        'public'            => true,
        'can_export'        => true,
        'show_ui'           => true, // UI in admin panel
        '_builtin'          => false, // It's a custom post type, not built in
        '_edit_link'        => 'post.php?post=%d',
        'capability_type'   => 'post',
        'menu_icon'         => 'dashicons-admin-multisite',
        'hierarchical'      => false, // Sets parent, child effect. Needs 'page-attributes' setting up
        'rewrite'           => array(
                                        "slug" => "house-types",
                                        "with_front" => false
                                    ), // Permalinks
        'query_var'         => "true", // This goes to the WP_Query schema
        'supports'          => array(   
                                        'title'
                                    ) ,
        'show_in_nav_menus' => true 
    )
); 
}

Can anyone recognize what went wrong on this occasion?

Thank you in advance!

8 – Download user-related file from the custom module

In a custom module, I want to display a file that refers to the username.
Files (PDFs of invoices) are listed in a table, and I want users to download the file directly.
And if the user enters the URL in a separate window, I want them to get "Access Denied".

I have set up a private directory and so far only the administrator can view the files.

We're talking about more than 3,000 potential users and more than 6,000 files added every month. Not every file belongs to a registered user. So I do not want to create a node for every file.

One option would be to replace the link with a form in which the action leads to a simple PHP script that validates data and then displays the file, but I'd like to leave things in Drupal if possible.

Custom endpoint error after migration from 2010 to 2016

I've updated the Sharepoint 2010 app to 2016. It has 3 custom endpoints. One of these is the following:

namespace AuthenticationWebService
{
    (BasicHttpBindingServiceMetadataExchangeEndpoint)
    (AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required))
    (ServiceContract)
    public class AuthenticationService
    {
        (OperationContract)
        (WebInvoke(Method = "POST",
         BodyStyle = WebMessageBodyStyle.Wrapped,
         ResponseFormat = WebMessageFormat.Json))
        public bool AuthenticateUser(string userName, string password)
        {
            return IsValidCredentials(userName, password);
        }

        internal static bool IsValidCredentials(string userName, string password)
        {
            bool isValid = false;

            if (userName.IndexOf(@"") > 0)
            {
                userName = userName.Substring(userName.IndexOf(@"") + 1);
            }

            string domain = SPContext.Current.Site.RootWeb.AllProperties("Authentication_Domain").ToString();

            using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, domain))
            {
                isValid = pc.ValidateCredentials(userName, password);
            }

            return isValid;
        }
    }
}

Really easy, just authenticate the user in a few forms to confirm the given action. This code was written for Sharepoint 2010 and migrated to 2016 via the Visual Studio upgrade.

The problem is that I can not seem to call this endpoint 2016 right. The same requirements that were implemented in 2010 give me "400 bad requirements" in 2016. Any ideas?

Custom Product Boxes WooCommerce – Everything Else

By

Carolyn Hall

With the WooCommerce custom product box plug-in, you can add simple or variations of a product in a mix-and-match box. With this module you can adjust the size of the box. WooCommerce custom product boxes allow you to create different types of boxes, such as: As lunch boxes, drinks, candy, shirts and desktop items. This extension provides dynamic pricing options for mix-and-match boxes. You can set a fixed price for the box per product or without the base price for the mix & match box. The price for this plugin is only $ 29 with a 100% money back guarantee.

Plugins – action or filter hook for a custom importer

I'm trying to write a custom bulk business location importer, but I'm having trouble choosing which action hook to use.

I wrote and tested it on a clean WordPress installation and it works fine there, but when I try to use it next to WooCommerce, I get an error message on every admin page.

I traced the error and think it's caused by the filter hook I want to use.

add_filter('pre_update_option',($this,'importLocations'),10,3);

My import method looks like this:

public function importLocations($newvalue,$option,$oldvalue){
    if('stockist_settings'==$option && !empty($newvalue('fileimport'))){

        $file=get_attached_file($newvalue('fileimport')(0));

        $locations=$this->parseCSVToArray($file);

        if(!empty($locations)){
            $prefix = $this->getAttributes()('slug')."_";
            foreach($locations as $location){

                // Checks that the longitude and latitude are filled out
                if(empty($location('Lat')) || empty($location('Lng'))){
                    $geocoder=new Geocoder();
                    $lnglat = $geocoder->geocodePostcode($location('Postcode'));
                    $location('Lat')=$lnglat('latitude');
                    $location('Lng')=$lnglat('longitude');
                }

                $social=$this->parseSocialMedia($location);

                $v = new ValitronValidator($location);
                $v->rules($this->setImportRules());
                if($v->validate()) {

                    $payload=(
                        'post_title'    =>  $location('CompanyName'),
                        'post_type'     =>  $this->getAttributes()('slug'),
                        'post_status'   =>  'publish',
                        'meta_input'    =>  (
                            $prefix.'address1'      =>  $location('Address1'),
                            $prefix.'address2'      =>  $location('Address2'),
                            $prefix.'address3'      =>  $location('Address3'),
                            $prefix.'city'          =>  $location('City'),
                            $prefix.'postcode'      =>  $location('Postcode'),
                            $prefix.'phonenumber'   =>  $location('PhoneNumber'),
                            $prefix.'website'       =>  $location('Website'),
                            $prefix.'email'         =>  $location('Email'),
                            $prefix.'longitude'     =>  $location('Lng'),
                            $prefix.'latitude'      =>  $location('Lat'),
                            $prefix.'socialrepeat_group'=>$social
                        )
                    );

                    $id=wp_insert_post($payload);

                } else {
                    // Errors
                    print_r($v->errors());
                }
            }

            wp_redirect(admin_url('/edit.php?post_type=stockists'),301);
        }
    }
}

Is there a better filter hook I should use or am I approaching bulk import completely from the wrong direction?

Desktop Customization – Where to Buy Custom Bracelets with No Minimum Order Quantity?

GS-JJ's ecommerce website is our latest effort to provide our high quality products and services directly to designers and end users.
USA: Los Angeles Office Address: 20829 Valley Blvd. Walnut, CA 91789
Canada: Vancouver Office Address: 27-5880 Hampton Place Vancouver, BC V6T 2E9
GS-JJ is one of the largest promotional gifts companies in China, whose mission is to offer its customers the best quality products at competitive prices and on time delivery!
Our product lines include: Lapel Pins / Medals / Affordable Lanyards / Belt Buckles / Challenge Coins / Ornaments / Embroidered Badges / Key Fobs / Custom Bracelets with no minimum and MORE ……
Contact with:
Website: https://www.gs-jj.com/wristbands/Custom-wristbands
E-Mail: info@gs-jj.com
Telephone: 18888644755
Fax: (909) 839-4501
Address: 20829 Valley Blvd. Walnut, CA 91789

Shortcode, vs Blocks, vs Templates – What would you do to select or create custom post data in Notepad?

Let's say you have a custom post type. Call my_type,

Say in Gutenberg now, you want too

one. Insert some data into my_type Contribution from an existing instance of another_type where the inserted block has template / styling

or

b. Insert some data into my_type that creates the habit another_type Post instance.

What is the most meaningful method? You can imagine doing this with a forum posting. In Gutenberg, you want to insert a reusable style block that displays specific forum topics. Or you may want to insert a block that creates the forum topic in the first place.

As it is now, I am creating the forum topic and then using a shortcode with the topic ID. But I wonder if there is a better way.

Thank you so much!
Brian