Tag Info

New answers tagged

0

It seems the problem is not with add_rewrite_rule rather with the .htaccessfile for the multi site. One of the test addresses was http://example.com/foobar/def/whatever.php Here's a part of the htaccess which causes the result (Line 2) RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] ...


1

$wpdb->prepare() is only necessary when trying to insert user input into a SQL query. If it's a "static" SQL query, it's not necessary.


0

check the get_current_blog_id function; that'll return the ID of the current blog.


0

There're some special tables Codex Link in Multisite. In short: No you can't. But you can degrade to a single site install and then import them there. If in doubt, simply add a new local multisite install, import the posts there, downgrade to single site and then export/import again.


1

Seems the answer was a lot simpler than I thought, so I thought I'd share the answer for those who stumble across this problem too. Clearly I was missing something in the database that was need, so I too an SQL dump of the database before and after dragging in a widget. Then compared the changes that happened. This helped me analyse what needed to be put ...


0

Only one thing I can see to solve this problem is to use redirection by .htaccess. But my question is, why don't you manage to redirect old URLs to the new version, without the /blog ? Because I guess, your concern is most about SEO no ? redirect 301 /blog/ http://www.yourdomain.com/


7

DB Access layer & deleting rows WordPress uses the wpdb class to manage access to the database layer using the global $wpdb. The class provides a method named delete() to delete rows from tables: $wpdb->delete( $table, $where, $where_format = null ); Multisite tables & activation keys WordPress has some MU specific tables, where one is ...


4

If you want a quick solution for deleting a signup in the database for a specific user, this should do what you want: /** * Delete a row in the signups table for a given username. * * @param string $user_login Username. * @return bool Whether the signup row was successfully deleted. */ function delete_activation_key_by_user( $user_login ) { global ...


2

And the answer is that a datetime cant have the CURRENT_TIMESTAMP default value since MySQL 5.6.5 so I changed modify_date from datetime to timestamp and all is good.


1

From the dbDelta() documentation: Note that the dbDelta function is rather picky, however. For instance: You must put each field on its own line in your SQL statement. You must have two spaces between the words PRIMARY KEY and the definition of your primary key. You must use the key word KEY rather than its synonym INDEX and you must include ...


0

You have site1 and site2 folders on your server, so Apache is serving those hence the file listing. Multisite however is trying to serve those sites using URL rewriting, so deleting those folders should fix the issue


0

this does not work, there is not any related errors in the available logs. I am still stucked in the second step where I should get the 2 radios telling me to choose between subdomains or subfolder config. You can find a print screen of the page here : http://screenpresso.com/=mRIld


0

You already seems to have an answer to your own problem with one potential overlook: git push. You don't need a shell access in order to git push your code base across multiple servers in matter of few commands. There are plenty of servers out there that are not self-managed and ban shell access but still let you manage your code via git.


1

This is the relevant code from ms_site_check(): $blog = get_blog_details(); // truncated if ( '1' == $blog->deleted ) { if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) ) return WP_CONTENT_DIR . '/blog-deleted.php'; else wp_die( __( 'This user has elected to delete their account and the content is no longer available.' ...


0

A blank page usually indicate that you have some php error. You should look at your PHP error log file and try to fix the error if there is one.


0

Yes, all the WordPress Multisite users go into the {$wpdb->prefix}users table; that way they form a pool of users that can each be given access to one or more sites in your network. You can get the users for a given site by using get_users(), which can take as an argument the ID of a given site: // get users for site example.com/my-site $args = array( ...


0

Well, actually, you should view your site as requiring "multilingual" capabilities, even if the base language for both countries is identical, because the actual locale for each is nevertheless different. More specifically, you can create variant "translations" for your British ('en_GB') and Irish ('en_IE') localizations. A plugin such WPML (WordPress ...


4

update_option( $name, $side_ad ); Your issue here is that update_option stores the value in the options table of the site. However you're on a multisite, and your install contains multiple sites/blogs, each with their own options tables. As a result, editing a user on blog/site A will not change the option on blog/site B, in the same way that painting a ...


0

Ok. Then you can use template_redirect hook and wp_is_mobile() conditional tag. wp_is_mobile() will work on device only. If you resize the window then it will not work. Now you can try this kind of code in your functions.php file add_action('template_redirect', 'redirecting_to_mobile_site'); function redirecting_to_mobile_site(){ if( wp_is_mobile() ){ ...


0

You can use the login_redirect filter: add_filter( 'login_redirect', 'wpse_159078_login_redirect' ); function wpse_159078_login_redirect( $redirect ) { if( ! current_user_can( 'update_core' ) ) { // if it's not a super admin that's logging in $redirect = get_home_url(); } return $redirect; } References login_redirect filter ...


-1

Try using anonymous windows in your browser or separate log ins. For e.g. I'm using Chrome and I can set up different browser accounts with different emails and passwords. It's kind of a cheat-solution, but it works fine:)


0

The order in which any plugins are loaded is not guaranteed and should not be relied upon. Instead, if you have processes which should happen after the plugins are loaded, then you should put those inside a function and then connect that function to the plugins_loaded action hook.



Top 50 recent answers are included