skip to Main Content

PHP Conditional Check for multiple WordPress Roles

I am looking for more performant code for selecting multiple WordPress roles as a check to run some code: if ( current_user_can( 'wholesale_customer' ) || current_user_can( 'wholesale_premium' ) || current_user_can( 'wholesale_nz') || current_user_can( 'wholesale_wa') ){ // do something } The…

VIEW QUESTION

MongoDB lookup (join) with field in double nested array

With a MongoDB collection name department with the following structure: { "_id":99, "name":"Erick Kalewe", "faculty":"Zazio", "lecturers":[ { "lecturerID":31, "name":"Granny Kinton", "email":"[email protected]", "imparts":[ { "groupID":70, "codCourse":99 } ] }, { "lecturerID":36, "name":"Michale Dahmel", "email":"[email protected]", "imparts":[ { "groupID":100, "codCourse":60 } ] }…

VIEW QUESTION

Match beginning of array with another array in mongodb

Let's say I have some documents that have an array like this: [ { "_id": ObjectId("5a934e000102030405000000"), "letters": ["a","b","c","d"] }, { "_id": ObjectId("5a934e000102030405000001"), "letters": ["a","b"] }, { "_id": ObjectId("5a934e000102030405000002"), "letters": ["a"] }, { "_id": ObjectId("5a934e000102030405000003"), "letters": ["x","a","b"] } ] I want…

VIEW QUESTION
Back To Top
Search