New answers tagged

2

any other way in Wordpress side to configure external user authentication but without developing anything? No. The only authentication WordPress provides out of the box is cookie based authentication. There are however plugin based solutions, specifically ones that rely on widely accepted standards that aren't unique to WordPress. These implement ...


0

PHP has a de-facto standard package manager called Composer. This does not only download packages (themes, plugins, the core) for you, but also solves dependency conflicts in case two of your dependencies/ packages request the same sub-package (de-duplication) and maybe even in different versions. There's the WordPress specific extension called WP Starter ...


-1

In your case you don't need any of these functions on $x, because its values are created by for loop and are safe.


2

Based on WordPress documentation for esc_attr function, it is returning a string value. So, If you need to have the integer value, you need using intval function. But, when you want to display that value or put it as part of markup, it doesn't make sense. Escape functions are useful for outputting and printing values. If you want to save a value in the ...


1

WP CLI is best tool out there to manage plugins/ themes through command line, instead of uploading plugins through FTP or admin panel. Once you Install WP-CLI on your machine then run below command and see magic. wp plugin install bbpress --activate Please check WP-CLI official documentation for further understanding.


0

Found: https://gist.github.com/squarestar/37fe1ff964adaddc0697dd03155cf0d0 as well as https://stackoverflow.com/questions/10353859/is-it-possible-to-programmatically-install-plugins-from-wordpress-theme Turns out there are quite a number of ways to do it, just not mentioned here at the wordpress stack exchange.


3

It's not possible with just WordPress to schedule code to run in the background at a specific time. WordPress, like most (if not all) PHP web applications, only actually runs in response to a URL being accessed, and a request being made to the server. For a scheduled event to run at a certain time, you would need to have something running on the server, such ...


0

I've recently forked a python script to do this, see https://gist.github.com/nikdow/cf1f1af4cef43c4ff90a0b8865f414cc it has a couple of weaknesses that need to be addressed - please help if you can. At the moment the script assumes that the highest "numbered" tag is the current one. I improved it to ignore tags that aren't of the form number.number... and ...


0

It's hard to answer that without some additional code to accompany it as those aren't WordPress core functions and could be doing anything really. Based on a previous question, I'll assume one of the plugins you're referring to is the LiquidChurch/lqd-messages plugin and I see those methods in the main plugin file. Even if this isn't the correct file, ...


1

Yours is a more general question, so I'll offer some general comments. There are WordPress plugins such as TablePress (https://tablepress.org) that do a nice job displaying data on a WordPress page. The individual data points can be made linkable to another page, as needed. This is, likely, a custom solution, meaning, a developer could help you structure ...


3

the async property is marked as protected, so that usually signifies that it is related more to your implementation's details rather than functionality. Ideally you would write your tests to test the public methods you have exposed. Testing that the class property you set in the constructor of one class is an instanceof what was initialized doesn't provide ...


0

You need to add the Loop to your template to display post content. Regular loop (the current page). <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <article> <h2><?php the_title(); ?></h2> </article> <?php endwhile; ?> <?php // Navigation ?> ...


0

<div class="menu-wrapper"> <div class="menu1"> <?php wp_nav_menu( array( 'theme_location' => 'menu-1', 'menu_id' => 'top-menu', ) ); ?> </div> <div class="menu2"> <?php wp_nav_menu( array( '...


1

Besides looking at your inbox for any messages that WP might send you (they don't always get sent), look at the error.log file in the site root and wp-admin folders. That will tell you where the error is. If it is a plugin, then rename that plugin's folder temporarily, then try the update again. You could also rename the entire plugin folder to temporarily ...


0

function searchstring_wpdb(){ global $wpdb; $mytables=$wpdb->get_results("SHOW TABLES"); $ss = 'cdn.cloudflare.com'; //string to search $used_is = ''; foreach ($mytables as $mytable) { foreach ($mytable as $table) { $existing_columns = $wpdb->get_col("DESC {$table}", 0); foreach ($...


1

In WP Admin go to Settings -> Permalinks and Save Changes. You don't need to change anything, just save. This resets wordpress rewrite rules which usually fixes 404 errors with newly added CPTs.


1

So this is how I have my structure setup to attempt to create a mu-plugin for my page. This statement does not make sense. Here is what I'm using: - Genesis Framework - Genesis FrameWork Child Theme mu-plugins have nothing to do with the Genesis framework. The Genesis framework is just a parent theme like any other WP theme. It was just built with the ...


1

Use the pre_get_posts hook to modify the $query and include your custom post types in the search. Add the following to your theme's functions.php file. function modify_query( $query ) { if ( is_home() ) { $query->set( 'post_type', array( 'post', 'articles', 'film_descriptions', 'book_descriptions', 'characters' ); } } add_action( '...


1

Find functions.php in your theme and add this code: function add_custom_pt( $query ) { if ( !is_admin() && $query->is_main_query() ) { $query->set( 'post_type', array( 'post', 'cptslug1', 'cptslug2' ) ); } } add_action( 'pre_get_posts', 'add_custom_pt' ); Change array values to match your post type slugs (add as many as you need), but ...


0

To make a working HTTP request with fetch API you have to do something like this. const form = new FormData(); form.append('action', 'make_appointment'); form.append('post_title', 'hola como estas'); const params = new URLSearchParams(form); fetch(ajaxSettings.ajaxurl, { method: 'POST', credentials: 'same-origin', headers: { '...


0

If you have admin access to your WP site you can login remotely via any web browser and use built in Updates function. To login to your site visit http://yoursite.url/wpadmin (replace yoursite.url with your web address. From your Dashboard you will see the Updates option which will check for updates of legitimate Plugins. If you are updating a plugin you ...


0

It really depends on what you're doing, but I agree in most cases using the settings API and running the code/instantiate the classes only when needed inside the callback is usually the best route to take opposed to instantiate everything upfront. Aside from the suggestions above - One approach I've taken a few times is hooking into some of the dynamic ...


0

The example in Settings API documentation uses admin_init and admin_menu for registering custom settings and admin pages. https://developer.wordpress.org/plugins/settings/custom-settings-page/ There's also an old Codex entry on actions typically run on front and back end requests, which can help pick a suitable action hook. https://codex.wordpress.org/...


0

For logged in users, use: wp_ajax_{$action} For logged out users, use: wp_ajax_nopriv_{$action} Your code is currently using wp_ajax_{$action} -> wp_ajax_nizam_handler which will restrict the request to logged in (authenticated users). If you are logged out at the time of the request, you will never make it into your callback. If you want to target ...


1

One option could be to use data attributes on the entires listed on pages one and two. Then attach a click event that reads the attribute value on click saves it to localStorage. This way you wouldn't need to make an extra db call on page three. In the loop the data attribute value can come basically from anywhere. E.g. post meta, some post field, taxonomy ...


1

A fast and easy solution is to fetch the slug with $_GET['page']. Don't forget to do some safety checks on the query after getting it. Also, while i'm on it, to make the submenu items show up below your top level you need to change the first property of add_submenu_page to your top level slug. add_action( 'admin_menu', 'MyPlugin_AddAdminMenus' ); function ...


-1

You need custom post type UI Plugin to create a post type like "posts" Link - https://wordpress.org/plugins/custom-post-type-ui/


0

Wordpress stores three levels of stock information on the wp_postmeta. Each product has manage stock enabled Stock Quantity Stock Status Since the products on the above questions were imported, few of them didn't had manage stock enabled so updating the stock quantity to 0 didn't work well. Solution: I forcefully updated the manage stock to be yes and ...


1

I don't believe that custom post types are a part of ACF. I use custom post type generators to add post types. This is the one that I use. You would just need to paste the resulting code at the bottom of your theme's functions.php file.


1

Your analysis of the problem is absolutely right. By having separate autoloaders in the theme and plugin you'll run into conflicts and only the first one being loaded. There is no easy and general solution to this, but if you control the whole stack the best solution probably is to put the whole site including WP under composer management and define the ...


0

If the GPX file is attached to the current page you can find it with get_attached_media(), e.g. $gpx_files = get_attached_media( 'application/gpx+xml' ); if ( count( $gpx_files ) >= 1 ) { echo do_shortcode ('[sgpx gpx="' . wp_get_attachment_url( $gpx_files[0]->ID ) . '"]'); } else { echo '<p class="warning">No GPX file attached!</p>...


0

SVN You find a list of all plugins inside the SVN - https://plugins.svn.wordpress.org/ Git Another option is the mirror on GitHub, there have a more useful API to doing thinks with the list. - https://github.com/wp-plugins API Also, you can use the API and his functions to get a more usable solution to parse for changes, etc., see https://developer....


0

I updated only those parts which leads to explain the things which I was trying to tell you in my first answer. plugin-name.php define("PLUGIN_DIR_PATH",plugin_dir_path(__FILE__)); add_action( 'admin_menu', 'wim_register_my_custom_menu_page' ); function wim_register_my_custom_menu_page() { add_menu_page( __( 'Plugin name', 'textdomain' ), ...


-1

You can right-click and download to get the list In HTML and save to you computer. Then do what you want. don't scrape it online.


0

Add a new URL using add_submenu_page (without any parent assigned) and post your form data on that URL. Refer to this page for adding sub-menu page. Also, you should not send form data on any PHP file like this. This, will opens up your plugin for external attacks. Let, know if you unable to figure out the way of doint this. Have a Good Day!


0

Yes, definitely Wordpress plugins are an essential part of the website as these plugins will completely transform your website. Payment gateways will make to secure your payment process which isn't complex. There are many payment plugins which can make the transaction in different currencies.


0

There are many extensions available on the internet. It includes payment gateways to site management, as these extensions will completely transform your site or E-Commerce store. ZOHO CRM integration is a payment gateway that will make your payment secure. Many extensions are also available on codecanyon.


0

At first I will notice that logging in with the username only sounds like a insecure solution . You should not display the form in the init action hook. Add form display function to the action hook from checkout page (e.g. woocommerce_before_checkout_form) or overwrite the checkout template in the active theme and insert the form there. if ( ! ...


0

I've found a solution by myself! With two lines of code I'm now able to save all the selected images and then retrive them on the front-end. I have added an array in the JS code part: // media library script (function($){ $(document).ready(function(){ $(document).on('click', '.upload_image_button', function(e){ e.preventDefault(); var ...


1

It feels slightly fragile, but you can probably just do: wp_scripts()->add_data( 'gpvb-admin-scripts', 'group', 1 ); in a low-priority admin_enqueue_scripts hook, since that's what wp_register_script does with the $is_footer flag. However this risks a future version of WordPress changing how this is saved internally (although it's been stable for 5+ ...


0

<script src="<?php echo plugins_url();?>/client/jquery.js"></script> <button id="excel" onClick ="$('#dataTable').tableExport({type:'excel',escape:'false'});"> XLS</button> <button id="print">Print me</button> <table class="dash-table" width="100%" cellspacing="0" cellpadding="10px" border="0" id="dataTable"> ...


0

For players you could create a custom post type, like so function my_player_cpt() { $labels = array( 'name' => _x( 'Players', 'Post type general name', 'textdomain' ), 'singular_name' => _x( 'Player', 'Post type singular name', 'textdomain' ), ); $args = array( 'labels' => $labels, '...


1

As Google stated, these warnings are suggestions for improvement. If you care about having your items listed as products in Google shopping, you should look into fixing the issue. If that doesn't apply, you don't necessarily have to address it. Typically for the best SEO, you do want to resolve this type of warning - if you don't offer actual products, ...


0

Yes, it is possible, To achieve this you need to understand basic REST-API and Server-Client communication. You need an API from your Other Website where the API will consume the input. And then your WordPress site will call that API with the parameters that contains data from your input form.


3

If you want to load it after jQuery, you can use script dependency... (3rd param) For example if your scripts depends on jQuery, you can use: wp_enqueue_script( 'login-script', plugin_dir_url( __FILE__ ) . 'scripts.js', array( 'jquery' ), null, true );


1

To handle the single domain, you'll want to obtain hosting that will run both your currently Azure-hosted site and WordPress. Usually Linux is the easiest way to go, though WP can run on IIS. You basically need to migrate the existing Azure-hosted site. Then, you can install WordPress in either a subdomain or a subfolder. If you want the two sites to appear ...


0

wp_authenticate() just checks user data, but not actually authenticating - docs. You can use wp_signon, which uses and wp_authenticate: source, like this: $credentials = [ 'user_login' => $name, 'user_password' => $password, 'rememberme' => true, ]; $signon = wp_signon($credentials, true); // true - use HTTP ...


1

The only way I can think of to achieve this without any custom coding is if your theme already displays Category descriptions. When you edit a Category, there is a "description" field where you would place the static information. However, many themes don't display this information. So, if you try adding a Category Description in wp-admin and it doesn't ...


0

Another way... https://developer.wordpress.org/reference/functions/media_sideload_image/ <?php $insert_post = array( 'post_author' => 1,//or get_current_user_id() 'post_status' => 'publish', 'post_type' => 'attachment', 'post_name' => 'attachment'.date('Ymd-H-i-s'), 'post_date' => date('Y-m-d H:i:s',time()), ); $post =...


0

I am working on this code for the front of an ERP application. Note that only after uploading will it be possible to insert the message. You will need to click edit to open the modal and enter the content. Maybe it's useful for you! Insert in your functions.php <?php if(!is_admin()){ if(!function_exists('ajax_upload_files')): ...


Top 50 recent answers are included